]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Fix data race in ChangeStatus 47196/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 20:38:43 +0000 (16:38 -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/54491
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/rgw/rgw_datalog.cc

index 550f08596b9cfd68176eb26f612e00fb0a50067e..545ec89370785225bc0c4d0a690603ecd08f8a2e 100644 (file)
@@ -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;
 }