From f6ca2bcb74757fbfd82d161a6db32100b417c359 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sun, 7 Dec 2014 09:01:00 -0800 Subject: [PATCH] os/FileStore: better debug on unlink Signed-off-by: Sage Weil --- src/os/FileStore.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index d020c2a256bca..2a4de80fdbe1a 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -437,8 +437,10 @@ int FileStore::lfn_unlink(coll_t cid, const ghobject_t& o, { Index index; int r = get_index(cid, &index); - if (r < 0) + if (r < 0) { + dout(25) << __func__ << " get_index failed " << cpp_strerror(r) << dendl; return r; + } assert(NULL != index.index); RWLock::WLocker l((index.index)->access_lock); @@ -463,6 +465,7 @@ int FileStore::lfn_unlink(coll_t cid, const ghobject_t& o, } else { assert(!m_filestore_fail_eio || r != -EIO); } + dout(25) << __func__ << " stat failed " << cpp_strerror(r) << dendl; return r; } else if (st.st_nlink == 1) { force_clear_omap = true; @@ -473,6 +476,7 @@ int FileStore::lfn_unlink(coll_t cid, const ghobject_t& o, << " in cid " << cid << dendl; r = object_map->clear(o, &spos); if (r < 0 && r != -ENOENT) { + dout(25) << __func__ << " omap clear failed " << cpp_strerror(r) << dendl; assert(!m_filestore_fail_eio || r != -EIO); return r; } @@ -489,7 +493,12 @@ int FileStore::lfn_unlink(coll_t cid, const ghobject_t& o, object_map->sync(&o, &spos); } } - return index->unlink(o); + r = index->unlink(o); + if (r < 0) { + dout(25) << __func__ << " index unlink failed " << cpp_strerror(r) << dendl; + return r; + } + return 0; } FileStore::FileStore(const std::string &base, const std::string &jdev, osflagbits_t flags, const char *name, bool do_update) : -- 2.39.5