From: Casey Bodley Date: Wed, 2 Sep 2020 15:38:29 +0000 (-0400) Subject: cls/rgw: unlink_instance writes updated olh log on early return X-Git-Tag: v16.1.0~1220^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9d41f2fff125cd90c31df89e34e5f4bf2ffd4806;p=ceph.git cls/rgw: unlink_instance writes updated olh log on early return Fixes: https://tracker.ceph.com/issues/47240 Signed-off-by: Casey Bodley --- diff --git a/src/cls/rgw/cls_rgw.cc b/src/cls/rgw/cls_rgw.cc index cd5e66f401b2..e4fa821d4ff1 100644 --- a/src/cls/rgw/cls_rgw.cc +++ b/src/cls/rgw/cls_rgw.cc @@ -1771,11 +1771,12 @@ static int rgw_bucket_unlink_instance(cls_method_context_t hctx, bufferlist *in, return ret; } - if (!obj.is_delete_marker()) { - olh.update_log(CLS_RGW_OLH_OP_REMOVE_INSTANCE, op.op_tag, op.key, false, op.olh_epoch); + if (obj.is_delete_marker()) { + return 0; } - return 0; + olh.update_log(CLS_RGW_OLH_OP_REMOVE_INSTANCE, op.op_tag, op.key, false, op.olh_epoch); + return olh.write(); } rgw_bucket_olh_entry& olh_entry = olh.get_entry();