From 91ec201255a23cee8897b4c527f0137215d2c424 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 27 May 2015 19:44:54 -0400 Subject: [PATCH] os/FileStore: better debug output for destroy_collection Signed-off-by: Sage Weil --- src/os/FileStore.cc | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 53afc8ed89209..70e7c36b84142 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -5027,33 +5027,37 @@ int FileStore::_create_collection( int FileStore::_destroy_collection(coll_t c) { + int r = 0; + char fn[PATH_MAX]; + get_cdir(c, fn, sizeof(fn)); + dout(15) << "_destroy_collection " << fn << dendl; { Index from; int r = get_index(c, &from); if (r < 0) - return r; + goto out; assert(NULL != from.index); RWLock::WLocker l((from.index)->access_lock); r = from->prep_delete(); if (r < 0) - return r; + goto out; } - char fn[PATH_MAX]; - get_cdir(c, fn, sizeof(fn)); - dout(15) << "_destroy_collection " << fn << dendl; - int r = ::rmdir(fn); - if (r < 0) + r = ::rmdir(fn); + if (r < 0) { r = -errno; + goto out; + } // destroy parallel temp collection, too if (!c.is_meta() && !c.is_temp()) { coll_t temp = c.get_temp(); r = _destroy_collection(temp); if (r < 0) - return r; + goto out; } - + r = 0; + out: dout(10) << "_destroy_collection " << fn << " = " << r << dendl; return r; } -- 2.39.5