xfs: quota limit statvfs available blocks
authorChristoph Hellwig <hch@infradead.org>
Thu, 21 Jan 2010 11:17:20 +0000 (11:17 +0000)
committerAlex Elder <aelder@sgi.com>
Thu, 21 Jan 2010 22:34:23 +0000 (16:34 -0600)
A "df" run on an NFS client of an exported XFS file system reports
the wrong information for "available" blocks.  When a block quota is
enforced, the amount reported as free is limited by the quota, but
the amount reported available is not (and should be).

Reported-by: Guk-Bong, Kwon <gbkwon@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
fs/xfs/quota/xfs_qm_bhv.c

index a534663..97b410c 100644 (file)
@@ -59,7 +59,7 @@ xfs_fill_statvfs_from_dquot(
                be64_to_cpu(dp->d_blk_hardlimit);
        if (limit && statp->f_blocks > limit) {
                statp->f_blocks = limit;
-               statp->f_bfree =
+               statp->f_bfree = statp->f_bavail =
                        (statp->f_blocks > be64_to_cpu(dp->d_bcount)) ?
                         (statp->f_blocks - be64_to_cpu(dp->d_bcount)) : 0;
        }