xfs
[Top] [All Lists]

[PATCH 2/2] xfs_quota: fix report command parsing

To: xfs@xxxxxxxxxxx
Subject: [PATCH 2/2] xfs_quota: fix report command parsing
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Fri, 9 Nov 2012 18:02:58 +1100
In-reply-to: <1352444578-14600-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1352444578-14600-1-git-send-email-david@xxxxxxxxxxxxx>
From: Dave Chinner <dchinner@xxxxxxxxxx>

The report command line needs to be parsed as a whole not as
individual elements - report_f() is set up to do this correctly.
When treated as non-global command line, the report function is
called once for each command line arg, resulting in reports being
issued multiple times.

Set the command to be a global command so that it is only called
once.

Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
---
 quota/report.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/quota/report.c b/quota/report.c
index a1e165b..70894a2 100644
--- a/quota/report.c
+++ b/quota/report.c
@@ -653,6 +653,7 @@ report_init(void)
        report_cmd.cfunc = report_f;
        report_cmd.argmin = 0;
        report_cmd.argmax = -1;
+       report_cmd.flags = CMD_FLAG_GLOBAL;
        report_cmd.args = _("[-bir] [-gpu] [-ahnt] [-f file]");
        report_cmd.oneline = _("report filesystem quota information");
        report_cmd.help = report_help;
-- 
1.7.10

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