From: Alex Elder Date: Wed, 24 Aug 2011 21:53:42 +0000 (+0000) Subject: xfsprogs: xfs_quota: don't double project block counts X-Git-Tag: v3.1.6~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7cb2d41b091468e197d3694e9cec5a1140122a05;p=thirdparty%2Fxfsprogs-dev.git xfsprogs: xfs_quota: don't double project block counts In projects_free_space_data() all of the block counts returned are doubled. This was probably a mistaken attempt to convert to or from 512-byte basic block units. The caller expects the value returned to be in 512-byte units, which is exactly what the fs_disk_quota structure holds, so there should be no doubling. The effect of this bug is that the disk space used by the "df" xfs_quota command shows block counts twice what they should be. SGI PV 1015651 Signed-off-by: Alex Elder Reviewed-by: Christoph Hellwig --- diff --git a/quota/free.c b/quota/free.c index 26ec293a1..71a7cb296 100644 --- a/quota/free.c +++ b/quota/free.c @@ -41,6 +41,10 @@ free_help(void) "\n")); } +/* + * The data and realtime block counts returned (count, used, and + * free) are all in basic block units. + */ static int mount_free_space_data( struct fs_path *mount, @@ -104,6 +108,10 @@ mount_free_space_data( return 1; } +/* + * The data and realtime block counts returned (count, used, and + * free) are all in basic block units. + */ static int projects_free_space_data( struct fs_path *path, @@ -173,10 +181,10 @@ projects_free_space_data( } if (d.d_blk_softlimit) { - *bcount = d.d_blk_softlimit << 1; - *bfree = (d.d_blk_softlimit - d.d_bcount) << 1; + *bcount = d.d_blk_softlimit; + *bfree = (d.d_blk_softlimit - d.d_bcount); } - *bused = d.d_bcount << 1; + *bused = d.d_bcount; if (d.d_ino_softlimit) { *icount = d.d_ino_softlimit; @@ -185,10 +193,10 @@ projects_free_space_data( *iused = d.d_icount; if (d.d_rtb_softlimit) { - *rcount = d.d_rtb_softlimit << 1; - *rfree = (d.d_rtb_softlimit - d.d_rtbcount) << 1; + *rcount = d.d_rtb_softlimit; + *rfree = (d.d_rtb_softlimit - d.d_rtbcount); } - *rused = d.d_rtbcount << 1; + *rused = d.d_rtbcount; close(fd); return 1;