[Top] [All Lists]

Re: xfs_quota -x -c 'report -u /dev/sde5' shows the duplicate result.

To: "yyq@xxxxxxxxx" <yyq@xxxxxxxxx>
Subject: Re: xfs_quota -x -c 'report -u /dev/sde5' shows the duplicate result.
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Fri, 9 Nov 2012 18:01:12 +1100
Cc: xfs@xxxxxxxxxxx
In-reply-to: <509CA82F.7030103@xxxxxxxxx>
References: <20121108222315.505370321@xxxxxxx> <20121108222315.709683665@xxxxxxx> <509C5885.5060300@xxxxxxxxx> <20121109012405.GX6434@dastard> <509C7825.1080401@xxxxxxxxx> <20121109053931.GA6434@dastard> <509CA82F.7030103@xxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Fri, Nov 09, 2012 at 02:52:31PM +0800, yyq@xxxxxxxxx wrote:
> 于 2012-11-9 13:39, Dave Chinner 写道:
> >On Fri, Nov 09, 2012 at 11:27:33AM +0800, yyq@xxxxxxxxx wrote:
> >>于 2012-11-9 9:24, Dave Chinner 写道:
> >>>On Fri, Nov 09, 2012 at 09:12:37AM +0800, yyq@xxxxxxxxx wrote:
> >>>>Hi,
> >>>>
> >>>>     When I use "xfs_quota -x -c 'report -u /dev/sde5'" to show
> >>>>/dev/sde5's quotas, and the result have two same block as below:
> >>>What version of xfs_quota are you using? What is the output of
> >>>/proc/mounts and /etc/mtab say?
> >>xfs_quota's version is 3.1.1 and output of /proc/mounts like this:
> >Can you attach the strace output of the command?

Thanks. The patch below should fix it. Can you try it?


Dave Chinner

xfs_quota: fix report command parsing

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

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;

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