From 9d41f2fff125cd90c31df89e34e5f4bf2ffd4806 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 2 Sep 2020 11:38:29 -0400 Subject: [PATCH] cls/rgw: unlink_instance writes updated olh log on early return Fixes: https://tracker.ceph.com/issues/47240 Signed-off-by: Casey Bodley --- src/cls/rgw/cls_rgw.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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(); -- 2.47.3