]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pacific: rgw: do not permit locked object version removal 47041/head
authorIgor Fedotov <igor.fedotov@croit.io>
Mon, 11 Jul 2022 14:59:00 +0000 (17:59 +0300)
committerIgor Fedotov <igor.fedotov@croit.io>
Fri, 15 Jul 2022 16:15:26 +0000 (19:15 +0300)
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 <igor.fedotov@croit.io>
src/rgw/rgw_sal_rados.cc

index 987653bd5f8ea786c7abe7f022fb0dc03c8fb2b8..6ba315f138b1804bd7f1b5fdf3f7ef8a4193ad2d 100644 (file)
@@ -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);
 }