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 <igor.fedotov@croit.io>