Skip to content

Commit 2b78a5b

Browse files
yukariatlastaodd
andcommitted
client: Prevent race condition when printing Inode in ll_sync_inode
In the ll_sync_inode function, the entire Inode structure is printed without holding a lock. This can lead to a race condition when evaluating the assertion in xlist<ObjectCacher::Object*>::size(), resulting in abnormal behavior. Fixes: https://tracker.ceph.com/issues/67491 Co-authored-by: dongdong tao <[email protected]> Signed-off-by: Chengen Du <[email protected]>
1 parent 530a260 commit 2b78a5b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/client/Client.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16140,7 +16140,7 @@ int Client::ll_sync_inode(Inode *in, bool syncdataonly)
1614016140
if (!mref_reader.is_state_satisfied())
1614116141
return -CEPHFS_ENOTCONN;
1614216142

16143-
ldout(cct, 3) << "ll_sync_inode " << *in << " " << dendl;
16143+
ldout(cct, 3) << "ll_sync_inode " << _get_vino(in) << " " << dendl;
1614416144
tout(cct) << "ll_sync_inode" << std::endl;
1614516145
tout(cct) << (uintptr_t)in << std::endl;
1614616146

0 commit comments

Comments
 (0)