We should never report more available space than free space.
'free' space might be limited by the blocks_allowed, while
the 'available' space calculation is for the total filesystem.
So if free is actually less than the calculated 'available', we must
reduce the 'available'.
Signed-off-by: NeilBrown <neilb@suse.de>
buf->f_bfree = buf->f_blocks - (fsroot->md.fs.cblocks_used +
fsroot->md.fs.pblocks_used +
fsroot->md.fs.ablocks_used);
+ if (buf->f_bfree < buf->f_bavail)
+ buf->f_bavail = buf->f_bfree;
dprintk("df: tot=%ld free=%ld avail=%ld(%ld-%ld-%ld) cb=%ld pb=%ld ab=%ld\n",
(long)buf->f_blocks, (long)buf->f_bfree, (long)buf->f_bavail,
(long)fs->free_blocks, (long)fs->clean_reserved,