xfs
[Top] [All Lists]

Re: [PATCH 6/6] xfs_quota: Fix range for -U.

To: Arkadiusz Miskiewicz <arekm@xxxxxxxx>
Subject: Re: [PATCH 6/6] xfs_quota: Fix range for -U.
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Mon, 15 Dec 2008 22:03:33 -0600
Cc: linux-xfs@xxxxxxxxxxx, Nathan Scott <nscott@xxxxxxxxxx>
In-reply-to: <1229369386-66312-6-git-send-email-arekm@xxxxxxxx>
References: <1229369386-66312-1-git-send-email-arekm@xxxxxxxx> <1229369386-66312-2-git-send-email-arekm@xxxxxxxx> <1229369386-66312-3-git-send-email-arekm@xxxxxxxx> <1229369386-66312-4-git-send-email-arekm@xxxxxxxx> <1229369386-66312-5-git-send-email-arekm@xxxxxxxx> <1229369386-66312-6-git-send-email-arekm@xxxxxxxx>
User-agent: Thunderbird 2.0.0.18 (Macintosh/20081105)
Arkadiusz Miskiewicz wrote:
> 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.

This seems like a good idea, although it changes behavior, and any
scripts that depended on this behavior will now get a different result.

Nathan, any thoughts?  I think you put this in originally :)

-Eric

> ---
>  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))

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