summaryrefslogtreecommitdiffstats
path: root/src/os/FuseStore.cc
diff options
context:
space:
mode:
authorZhi Zhang <willzzhang@tencent.com>2017-11-20 10:11:45 +0100
committerZhi Zhang <willzzhang@tencent.com>2017-11-20 10:11:45 +0100
commitcbda01c95e958090575b87bfee6c4b7415a65019 (patch)
tree126ae40878373dc1517347be054cca57398ef001 /src/os/FuseStore.cc
parentMerge pull request #18980 from shinobu-x/os_filestore_filestore_nit_cleanup (diff)
downloadceph-cbda01c95e958090575b87bfee6c4b7415a65019.tar.xz
ceph-cbda01c95e958090575b87bfee6c4b7415a65019.zip
os/FuseStore: fix incorrect used space statistics for fuse's statfs interface
Signed-off-by: Zhi Zhang <zhangz.david@outlook.com>
Diffstat (limited to 'src/os/FuseStore.cc')
-rw-r--r--src/os/FuseStore.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/os/FuseStore.cc b/src/os/FuseStore.cc
index 724909c55c6..ffad0c86738 100644
--- a/src/os/FuseStore.cc
+++ b/src/os/FuseStore.cc
@@ -1103,7 +1103,10 @@ static int os_statfs(const char *path, struct statvfs *stbuf)
stbuf->f_bsize = 4096; // LIES!
stbuf->f_blocks = s.total / 4096;
stbuf->f_bavail = s.available / 4096;
+ stbuf->f_bfree = stbuf->f_bavail;
+ ldout(fs->store->cct, 10) << __func__ << " " << path << ": "
+ << stbuf->f_bavail << "/" << stbuf->f_blocks << dendl;
return 0;
}