From: Christopher Hoffman Date: Mon, 11 Aug 2025 14:30:05 +0000 (+0000) Subject: client: move mref_reader check in statfs out of helper X-Git-Tag: testing/wip-pdonnell-testing-20260323.122957-tentacle~709 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2961d71209bc0a8ed3728e17f43b5dd2df0cc2e6;p=ceph-ci.git client: move mref_reader check in statfs out of helper Signed-off-by: Christopher Hoffman (cherry picked from commit 9ab1209a68d450eca9bf915a605200ab92e53926) Resolves: rhbz#2389764 --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 69c46c82164..8da83c204d7 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -13212,10 +13212,6 @@ int Client::getcwd(string& dir, const UserPerm& perms) int Client::_statfs(Inode *in, struct statvfs *stbuf, const UserPerm& perms) { - RWRef_t mref_reader(mount_state, CLIENT_MOUNTING); - if (!mref_reader.is_state_satisfied()) - return -ENOTCONN; - ldout(cct, 10) << __func__ << dendl; tout(cct) << __func__ << std::endl; unsigned long int total_files_on_fs; @@ -13653,6 +13649,10 @@ int Client::get_snap_info(const char *path, const UserPerm &perms, SnapInfo *sna int Client::ll_statfs(Inode *in, struct statvfs *stbuf, const UserPerm& perms) { + RWRef_t mref_reader(mount_state, CLIENT_MOUNTING); + if (!mref_reader.is_state_satisfied()) + return -ENOTCONN; + /* Since the only thing this does is wrap a call to statfs, and statfs takes a lock, it doesn't seem we have a need to split it out. */ @@ -13661,6 +13661,10 @@ int Client::ll_statfs(Inode *in, struct statvfs *stbuf, const UserPerm& perms) int Client::statfs(const char *path, struct statvfs *stbuf, const UserPerm& perms) { + RWRef_t mref_reader(mount_state, CLIENT_MOUNTING); + if (!mref_reader.is_state_satisfied()) + return -ENOTCONN; + walk_dentry_result wdr; { std::scoped_lock l(client_lock);