From 2b78a5b3147d4e97be332ca88d286aec0ce44dc3 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 --- 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 5f78e73f92224..8f62bbbca7997 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -16140,7 +16140,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