xfs
[Top] [All Lists]

[PATCH 1/3] xfsprogs: xfs_quota: return real-time used data as intended

To: xfs@xxxxxxxxxxx
Subject: [PATCH 1/3] xfsprogs: xfs_quota: return real-time used data as intended
From: Alex Elder <aelder@xxxxxxx>
Date: Wed, 24 Aug 2011 16:53:41 -0500
Cc: Alex Elder <aelder@xxxxxxx>
In-reply-to: <1314222823-24101-1-git-send-email-aelder@xxxxxxx>
References: <1314222823-24101-1-git-send-email-aelder@xxxxxxx>
In projects_free_space_data() the real-time used space consumption
is never set.  Instead, that value is returned in the field that
should hold the quota limit.

Found by inspection.  Never seen/noticed because we currently don't
support quotas when a filesystem has a realtime volume.

Signed-off-by: Alex Elder <aelder@xxxxxxx>
---
 quota/free.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/quota/free.c b/quota/free.c
index 825ce34..26ec293 100644
--- a/quota/free.c
+++ b/quota/free.c
@@ -177,16 +177,18 @@ projects_free_space_data(
                *bfree = (d.d_blk_softlimit - d.d_bcount) << 1;
        }
        *bused = d.d_bcount << 1;
+
        if (d.d_ino_softlimit) {
                *icount = d.d_ino_softlimit;
                *ifree = (d.d_ino_softlimit - d.d_icount);
        }
        *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_rtbcount << 1;
+       *rused = d.d_rtbcount << 1;
 
        close(fd);
        return 1;
-- 
1.7.6

<Prev in Thread] Current Thread [Next in Thread>