xfs
[Top] [All Lists]

[PATCH 09/20] xfs_quota: Fix range for -U.

To: xfs@xxxxxxxxxxx
Subject: [PATCH 09/20] xfs_quota: Fix range for -U.
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Mon, 22 Dec 2008 11:38:40 -0500
Cc: Arkadiusz Miskiewicz <arekm@xxxxxxxx>
References: <20081222163831.755809000@bombadil.infradead.org>
User-agent: quilt/0.46-1
From: Arkadiusz Miskiewicz <arekm@xxxxxxxx>


xfs_quota report "-L" option specifies lower range of requested IDs.
"-U" specifies upper range but "-L" is closed range while "-U" is open
range.

Make "-U" closed range, too which is something more expected.



Reviewed-by: Christoph Hellwig <hch@xxxxxx>

---
 xfsprogs/quota/report.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xfsprogs/quota/report.c b/xfsprogs/quota/report.c
index 21b4edb..2184158 100644
--- a/xfsprogs/quota/report.c
+++ b/xfsprogs/quota/report.c
@@ -124,7 +124,7 @@ dump_limits_any_type(
        }
 
        if (upper) {
-               for (id = lower; id < upper; id++)
+               for (id = lower; id <= upper; id++)
                        dump_file(fp, id, type, mount->fs_name);
                return;
        }
@@ -398,7 +398,7 @@ report_user_mount(
        uint            id;
 
        if (upper) {    /* identifier range specified */
-               for (id = lower; id < upper; id++) {
+               for (id = lower; id <= upper; id++) {
                        snprintf(n, sizeof(n)-1, "#%u", id);
                        if (report_mount(fp, id, n,
                                        form, XFS_USER_QUOTA, mount, flags))
@@ -436,7 +436,7 @@ report_group_mount(
        uint            id;
 
        if (upper) {    /* identifier range specified */
-               for (id = lower; id < upper; id++) {
+               for (id = lower; id <= upper; id++) {
                        snprintf(n, sizeof(n)-1, "#%u", id);
                        if (report_mount(fp, id, n,
                                        form, XFS_GROUP_QUOTA, mount, flags))
@@ -473,7 +473,7 @@ report_project_mount(
        uint            id;
 
        if (upper) {    /* identifier range specified */
-               for (id = lower; id < upper; id++) {
+               for (id = lower; id <= upper; id++) {
                        snprintf(n, sizeof(n)-1, "#%u", id);
                        if (report_mount(fp, id, n,
                                        form, XFS_PROJ_QUOTA, mount, flags))
-- 
1.6.0.5

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs

-- 

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