From: Chengen Du Date: Mon, 12 Aug 2024 07:49:57 +0000 (+0800) Subject: client: Prevent race condition when printing Inode in ll_sync_inode X-Git-Tag: testing/wip-rishabh-testing-20240909.104658-reef~4^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=78b3e6d9368ecdda7c24a3593499901e56051378;p=ceph-ci.git 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::size(), resulting in abnormal behavior. Fixes: https://tracker.ceph.com/issues/67491 Co-authored-by: dongdong tao Signed-off-by: Chengen Du (cherry picked from commit 2b78a5b3147d4e97be332ca88d286aec0ce44dc3) --- diff --git a/src/client/Client.cc b/src/client/Client.cc index a84e69f38f2..42b5d1f8635 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -15347,7 +15347,7 @@ int Client::ll_sync_inode(Inode *in, bool syncdataonly) if (!mref_reader.is_state_satisfied()) return -CEPHFS_ENOTCONN; - ldout(cct, 3) << "ll_sync_inode " << *in << " " << dendl; + ldout(cct, 3) << "ll_sync_inode " << _get_vino(in) << " " << dendl; tout(cct) << "ll_sync_inode" << std::endl; tout(cct) << (uintptr_t)in << std::endl;