]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfsprogs: xfs_quota: don't double project block counts
authorAlex Elder <aelder@sgi.com>
Wed, 24 Aug 2011 21:53:42 +0000 (21:53 +0000)
committerAlex Elder <aelder@sgi.com>
Fri, 26 Aug 2011 01:40:34 +0000 (20:40 -0500)
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 <aelder@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
quota/free.c

index 26ec293a17814989e4454e5eaf64b46afc3faa75..71a7cb29659663c4b73ed9aa434d7f851f537bdc 100644 (file)
@@ -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;