Skip to content

Commit eb25bf2

Browse files
authored
Merge pull request ceph#44946 from adamemerson/wip-54208
rgw: Fix data race in ChangeStatus Reviewed-by: Casey Bodley <[email protected]>
2 parents 78af510 + 27f5ba9 commit eb25bf2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/rgw/rgw_datalog.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,13 +566,17 @@ void RGWDataChangesLog::register_renew(const rgw_bucket_shard& bs)
566566
void RGWDataChangesLog::update_renewed(const rgw_bucket_shard& bs,
567567
real_time expiration)
568568
{
569-
std::scoped_lock l{lock};
569+
std::unique_lock l{lock};
570570
ChangeStatusPtr status;
571571
_get_change(bs, status);
572+
l.unlock();
573+
572574

573575
ldout(cct, 20) << "RGWDataChangesLog::update_renewd() bucket_name="
574576
<< bs.bucket.name << " shard_id=" << bs.shard_id
575577
<< " expiration=" << expiration << dendl;
578+
579+
std::unique_lock sl(status->lock);
576580
status->cur_expiration = expiration;
577581
}
578582

0 commit comments

Comments
 (0)