]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: set f_files to the total number of files in the filesystem 23323/head
authorRishabh Dave <ridave@redhat.com>
Mon, 30 Jul 2018 05:15:08 +0000 (05:15 +0000)
committerRishabh Dave <ridave@redhat.com>
Tue, 21 Aug 2018 09:03:32 +0000 (09:03 +0000)
Fixes: http://tracker.ceph.com/issues/24849
Signed-off-by: Rishabh Dave <ridave@redhat.com>
src/client/Client.cc

index e585ed90164e4f2692e80dd372e256421a909829..afc9a44edcb3d67c8174fa0bf1d2df55191df264 100644 (file)
@@ -9769,6 +9769,7 @@ int Client::statfs(const char *path, struct statvfs *stbuf,
 {
   Mutex::Locker l(client_lock);
   tout(cct) << __func__ << std::endl;
+  unsigned long int total_files_on_fs;
 
   if (unmounting)
     return -ENOTCONN;
@@ -9785,6 +9786,8 @@ int Client::statfs(const char *path, struct statvfs *stbuf,
 
   client_lock.Unlock();
   int rval = cond.wait();
+  assert(root);
+  total_files_on_fs = root->rstat.rfiles + root->rstat.rsubdirs;
   client_lock.Lock();
 
   if (rval < 0) {
@@ -9806,8 +9809,8 @@ int Client::statfs(const char *path, struct statvfs *stbuf,
   const int CEPH_BLOCK_SHIFT = 22;
   stbuf->f_frsize = 1 << CEPH_BLOCK_SHIFT;
   stbuf->f_bsize = 1 << CEPH_BLOCK_SHIFT;
-  stbuf->f_files = stats.num_objects;
-  stbuf->f_ffree = -1;
+  stbuf->f_files = total_files_on_fs;
+  stbuf->f_ffree = 0;
   stbuf->f_favail = -1;
   stbuf->f_fsid = -1;       // ??
   stbuf->f_flag = 0;        // ??