@@ -12529,10 +12529,6 @@ int Client::getcwd(string& dir, const UserPerm& perms)
1252912529int Client::_statfs (Inode *in, struct statvfs *stbuf,
1253012530 const UserPerm& perms)
1253112531{
12532- RWRef_t mref_reader (mount_state, CLIENT_MOUNTING);
12533- if (!mref_reader.is_state_satisfied ())
12534- return -ENOTCONN;
12535-
1253612532 ldout (cct, 10 ) << __func__ << dendl;
1253712533 tout (cct) << __func__ << std::endl;
1253812534 unsigned long int total_files_on_fs;
@@ -12970,6 +12966,10 @@ int Client::get_snap_info(const char *path, const UserPerm &perms, SnapInfo *sna
1297012966
1297112967int Client::ll_statfs (Inode *in, struct statvfs *stbuf, const UserPerm& perms)
1297212968{
12969+ RWRef_t mref_reader (mount_state, CLIENT_MOUNTING);
12970+ if (!mref_reader.is_state_satisfied ())
12971+ return -ENOTCONN;
12972+
1297312973 /* Since the only thing this does is wrap a call to statfs, and
1297412974 statfs takes a lock, it doesn't seem we have a need to split it
1297512975 out. */
@@ -12978,6 +12978,10 @@ int Client::ll_statfs(Inode *in, struct statvfs *stbuf, const UserPerm& perms)
1297812978
1297912979int Client::statfs (const char *path, struct statvfs *stbuf, const UserPerm& perms)
1298012980{
12981+ RWRef_t mref_reader (mount_state, CLIENT_MOUNTING);
12982+ if (!mref_reader.is_state_satisfied ())
12983+ return -ENOTCONN;
12984+
1298112985 walk_dentry_result wdr;
1298212986 {
1298312987 std::scoped_lock l (client_lock);
0 commit comments