From 78b3e6d9368ecdda7c24a3593499901e56051378 Mon Sep 17 00:00:00 2001 From: Chengen Du Date: Mon, 12 Aug 2024 15:49:57 +0800 Subject: [PATCH] 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) --- src/client/Client.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.39.5