summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@inktank.com>2013-08-19 16:56:27 -0700
committerYehuda Sadeh <yehuda@inktank.com>2013-08-19 16:56:27 -0700
commitd7fd60b951443558ccb1c7fa31e1bb15d7eb4fea (patch)
tree01ab9357e56a3f081f4b07bccc6df36f3ea83a54
parente23b817ad0cf1ea19c0a7b7c9999b30bed37d533 (diff)
downloadceph-wip-6056.tar.gz
rgw: bucket meta remove don't overwrite entry point firstwip-6056
Fixes: #6056 When removing a bucket metadata entry we first unlink the bucket and then we remove the bucket entrypoint object. Originally when unlinking the bucket we first overwrote the bucket entrypoint entry marking it as 'unlinked'. However, this is not really needed as we're just about to remove it. The original version triggered a bug, as we needed to propagate the new header version first (which we didn't do, so the subsequent bucket removal failed). Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r--src/rgw/rgw_bucket.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/rgw/rgw_bucket.cc b/src/rgw/rgw_bucket.cc
index 3cb730b555e..c6498daaf42 100644
--- a/src/rgw/rgw_bucket.cc
+++ b/src/rgw/rgw_bucket.cc
@@ -1450,7 +1450,13 @@ public:
if (ret < 0)
return ret;
- ret = rgw_unlink_bucket(store, be.owner, entry);
+ /*
+ * Note that we unlink the bucket but don't want the entry point to be updated
+ * as we're going to remove it immediately after that. Another reason why we
+ * do that is that if we update the entry point, we'll also need to update
+ * objv_tracker, otherwise the following bucket obj removal is going to fail.
+ */
+ ret = rgw_unlink_bucket(store, be.owner, entry, false);
if (ret < 0) {
lderr(store->ctx()) << "could not unlink bucket=" << entry << " owner=" << be.owner << dendl;
}