From: Dan Robertson Date: Wed, 23 Jun 2021 23:25:00 +0000 (-0400) Subject: bcachefs: statfs bfree and bavail should be the same X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e8e9607f3c1bb927002b7582b68d36c7eb3e92e2;p=linux.git 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 Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c index 71e738b989672..1b0d63219c3b4 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;