From 77ef056588674b619332c8684c5d7bef3ac8a439 Mon Sep 17 00:00:00 2001 From: Igor Fedotov Date: Mon, 11 Jul 2022 17:59:00 +0300 Subject: [PATCH] pacific: rgw: do not permit locked object version removal This commit targets Pacific explicitly and hence "violates" regular backporting policy due to the fact that Quincy onward releases aren't impacted by the bug. Post-Pacific releases have got a major update through https://github.com/ceph/ceph/pull/39399 which in particular fixes the case. For reasons we would prefer not to backport this update completely hence just the partial minor patch here. Some more details on the bug can be found in the relevant ticket's comments as well. Additional note about the implementation: originally the patch relied on using RGWObject::get_obj function but this implementation causes rgw process access vialotaion when running some of test cases in s3-tests suite. The root cause is apparently an uninitialized bucket pointer at RGWObject under some circumstances. Hence that get_obj() implementation is copy-pasted to RGWRadosObject::get_obj_state() and altered a bit to use local bucket reference. Fixes: https://tracker.ceph.com/issues/55766 Signed-off-by: Igor Fedotov --- src/rgw/rgw_sal_rados.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_sal_rados.cc b/src/rgw/rgw_sal_rados.cc index 987653bd5f8ea..6ba315f138b18 100644 --- a/src/rgw/rgw_sal_rados.cc +++ b/src/rgw/rgw_sal_rados.cc @@ -426,7 +426,9 @@ int RGWObject::range_to_ofs(uint64_t obj_size, int64_t &ofs, int64_t &end) int RGWRadosObject::get_obj_state(const DoutPrefixProvider *dpp, RGWObjectCtx *rctx, RGWBucket& bucket, RGWObjState **state, optional_yield y, bool follow_olh) { - rgw_obj obj(bucket.get_key(), key.name); + rgw_obj obj(bucket.get_key(), key); + obj.set_in_extra_data(in_extra_data); + obj.index_hash_source = index_hash_source; return store->getRados()->get_obj_state(dpp, rctx, bucket.get_info(), obj, state, follow_olh, y); } -- 2.39.5