From d7fd60b951443558ccb1c7fa31e1bb15d7eb4fea Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Mon, 19 Aug 2013 16:56:27 -0700 Subject: rgw: bucket meta remove don't overwrite entry point first 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 --- src/rgw/rgw_bucket.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.1