Skip to contentSkip to conversation

f2fs: report delalloc reserve as non-free in statfs for project quota

PATCH In review Konstantin Khlebnikov 2 participants 2 messages May 11, 2020 – May 12, 2020 F2FS file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 fs/f2fs/super.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/f2fs/super.c +2 -1
index f2dfc21c6abb..c5e8cb31626f 100644
@@ -1292,7 +1292,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) ?
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Konstantin Khlebnikov

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")

Thanks,