ext4: 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. XFS already does this.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
Fixes: 689c958cbe ("ext4: add project quota support")
This commit is contained in:
Konstantin Khlebnikov 2018-05-20 22:49:54 -04:00 committed by Theodore Ts'o
parent 21c580d88e
commit f06925c739

View File

@ -5289,7 +5289,8 @@ static int ext4_statfs_project(struct super_block *sb,
dquot->dq_dqb.dqb_bsoftlimit : dquot->dq_dqb.dqb_bsoftlimit :
dquot->dq_dqb.dqb_bhardlimit) >> sb->s_blocksize_bits; dquot->dq_dqb.dqb_bhardlimit) >> sb->s_blocksize_bits;
if (limit && buf->f_blocks > limit) { 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_blocks = limit;
buf->f_bfree = buf->f_bavail = buf->f_bfree = buf->f_bavail =
(buf->f_blocks > curblock) ? (buf->f_blocks > curblock) ?