From b24fdabfaf09bbc3d5dfcf5bf82f39f24d69e73e Mon Sep 17 00:00:00 2001 From: "Adam C. Emerson" Date: Tue, 8 Feb 2022 13:47:49 -0500 Subject: [PATCH] rgw: Fix data race in ChangeStatus Fixes: https://tracker.ceph.com/issues/54208 Signed-off-by: Adam C. Emerson (cherry picked from commit 27f5ba9e5f649d8767c8ab44d56404e0186f6fc1) Fixes: https://tracker.ceph.com/issues/54491 Signed-off-by: Adam C. Emerson --- src/rgw/rgw_datalog.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_datalog.cc b/src/rgw/rgw_datalog.cc index 550f08596b9cf..545ec89370785 100644 --- a/src/rgw/rgw_datalog.cc +++ b/src/rgw/rgw_datalog.cc @@ -567,13 +567,17 @@ void RGWDataChangesLog::register_renew(const rgw_bucket_shard& bs) void RGWDataChangesLog::update_renewed(const rgw_bucket_shard& bs, real_time expiration) { - std::scoped_lock l{lock}; + std::unique_lock l{lock}; ChangeStatusPtr status; _get_change(bs, status); + l.unlock(); + ldout(cct, 20) << "RGWDataChangesLog::update_renewd() bucket_name=" << bs.bucket.name << " shard_id=" << bs.shard_id << " expiration=" << expiration << dendl; + + std::unique_lock sl(status->lock); status->cur_expiration = expiration; } -- 2.39.5