summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Robertson <dan@dlrobertson.com>2021-06-23 19:25:00 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:07 -0400
commite8e9607f3c1bb927002b7582b68d36c7eb3e92e2 (patch)
treefa799e72c40ec7a74a1a8518099aca0c8684527a
parentfdc6b08451167bfc1ae260b252ad2bf2f9735f50 (diff)
downloadlinux-stable-e8e9607f3c1bb927002b7582b68d36c7eb3e92e2.tar.gz
linux-stable-e8e9607f3c1bb927002b7582b68d36c7eb3e92e2.tar.bz2
linux-stable-e8e9607f3c1bb927002b7582b68d36c7eb3e92e2.zip
bcachefs: statfs bfree and bavail should be the same
The value of f_bfree and f_bavail should be the same. The value of f_bfree is not currently scaled by the availability factor. Signed-off-by: Dan Robertson <dan@dlrobertson.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r--fs/bcachefs/fs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c
index 71e738b98967..1b0d63219c3b 100644
--- a/fs/bcachefs/fs.c
+++ b/fs/bcachefs/fs.c
@@ -1277,8 +1277,8 @@ static int bch2_statfs(struct dentry *dentry, struct kstatfs *buf)
buf->f_type = BCACHEFS_STATFS_MAGIC;
buf->f_bsize = sb->s_blocksize;
buf->f_blocks = usage.capacity >> shift;
- buf->f_bfree = usage.free >> shift;
- buf->f_bavail = avail_factor(usage.free) >> shift;
+ buf->f_bfree = avail_factor(usage.free) >> shift;
+ buf->f_bavail = buf->f_bfree;
buf->f_files = usage.nr_inodes + avail_inodes;
buf->f_ffree = avail_inodes;