summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorKonstantin Khlebnikov <khlebnikov@yandex-team.ru>2020-05-11 08:15:18 +0200
committerJaegeuk Kim <jaegeuk@kernel.org>2020-05-12 05:36:47 +0200
commitbaaa7ebf25c78c5cb712fac16b7f549100beddd3 (patch)
treed9f7e13f31b3a63540d78e4e775767e62c42d3de /fs
parentf2fs: Fix wrong stub helper update_sit_info (diff)
downloadlinux-baaa7ebf25c78c5cb712fac16b7f549100beddd3.tar.xz
linux-baaa7ebf25c78c5cb712fac16b7f549100beddd3.zip
f2fs: report delalloc reserve as non-free in statfs for project quota
This reserved space isn't committed yet but cannot be used for allocations. For userspace it has no difference from used space. See the same fix in ext4 commit f06925c73942 ("ext4: report delalloc reserve as non-free in statfs for project quota"). Fixes: ddc34e328d06 ("f2fs: introduce f2fs_statfs_project") Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/super.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 582bbf40c559..f6c5c7ec5a12 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1283,7 +1283,8 @@ static int f2fs_statfs_project(struct super_block *sb,
limit >>= sb->s_blocksize_bits;
if (limit && buf->f_blocks > limit) {
- curblock = dquot->dq_dqb.dqb_curspace >> sb->s_blocksize_bits;
+ curblock = (dquot->dq_dqb.dqb_curspace +
+ dquot->dq_dqb.dqb_rsvspace) >> sb->s_blocksize_bits;
buf->f_blocks = limit;
buf->f_bfree = buf->f_bavail =
(buf->f_blocks > curblock) ?