]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Fix data race in ChangeStatus 47195/head
authorAdam C. Emerson <aemerson@redhat.com>
Tue, 8 Feb 2022 18:47:49 +0000 (13:47 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Wed, 20 Jul 2022 19:59:15 +0000 (15:59 -0400)
Fixes: https://tracker.ceph.com/issues/54208
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
(cherry picked from commit 27f5ba9e5f649d8767c8ab44d56404e0186f6fc1)
Fixes: https://tracker.ceph.com/issues/54208
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/rgw/rgw_datalog.cc

index 89e41471e11c75458158e17291180434d3d699d7..b52e52000774420de465eaef75eedb76fc861f1e 100644 (file)
@@ -566,13 +566,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;
 }