<p dir="ltr"><br>
2016年5月12日 02:54,"Eric Sandeen" <<a href="mailto:sandeen@sandeen.net">sandeen@sandeen.net</a>>写道:<br>
><br>
><br>
><br>
> On 5/11/16 12:36 PM, Zorro Lang wrote:<br>
> > On Wed, May 11, 2016 at 11:04:28AM -0500, Eric Sandeen wrote:<br>
> >> On 5/11/16 10:05 AM, Zorro Lang wrote:<br>
> >>> After GETNEXTQUOTA ioctl be supported, xfs_quota -c "report" always<br>
> >>> outputs one more quota info about default quota (as project ID 0).<br>
> >>> For fix this problem, xfsprogs has merged commit 3d607a1.<br>
> >><br>
> >> This is only for project quota, right? user & group quota always<br>
> >> reports id 0 / root, because it exists in the passwd and group files.<br>
> ><br>
> > Yes, only for project quota. The truth is we decide to report project<br>
> > quota #0 always, so we can just add one line "#0 0 0 0 00 ...." into<br>
> > xfs/133 and xfs/134 golden output file simply.<br>
> ><br>
> > But for history reason, we can't do that. Mostly old xfsprogs still<br>
> > report "(null) 0 0 0 00 ..."(if use GETNEXTQUOTA), or don't report<br>
> > project id #0 (if use old GETQUOTA).<br>
><br>
> Right, so filter that out? ;)<br>
><br>
> ...<br>
><br>
> >> Why not just do it as an actual filter, i.e.:<br>
> >><br>
> >><br>
> >><br>
> >> diff --git a/common/filter b/common/filter<br>
> >> index 1be377c..2012729 100644<br>
> >> --- a/common/filter<br>
> >> +++ b/common/filter<br>
> >> @@ -302,6 +302,13 @@ _filter_quota()<br>
> >> sed -e 'N;s/TEST_DEV\n/TEST_DEV/g'<br>
> >> }<br>
> >><br>
> >> +_filter_project_quota()<br>
> >> +{<br>
> >> + # Project ID 0 is always present on disk but was not reported<br>
> >> + # until the GETNEXTQUOTA ioctl came into use. Filter it out.<br>
> >> + _filter_quota | grep -v "^\#0"<br>
> >> +}<br>
> ><br>
> > I thought about this before I send this patch. But I don't know if it's<br>
> > necessary to add a new common function. I thought the one who write<br>
> > a case need to report project, who can decide how to deal with<br>
> > its project id #0 output.<br>
> ><br>
> > Likes what I did in xfs/133. I named projid 0 to "root", then fileter<br>
> > project name root directly. If we add a function named _filter_project_quota,<br>
> > and we tell others it can filter project ID 0. But if someone named<br>
> > projid #0, this function become hard to understand.<br>
><br>
> yes, but that's a lot of manual fiddling for every test that does a report<br>
> of a project quota. Most don't care at all about id 0.<br>
><br>
> If someone wants project ID 0 reported, just use _filter_quota instead<br>
> of _filter_project_quota.<br>
><br>
> If someone gives prjid 0 a name "foobarbaz" then it won't be filtered,<br>
> and I think that's fine, they were doing something quite intentional.<br>
> All the filter does is suppress the default output which is new to any<br>
> test reporting project quota.<br>
><br>
> > Likes xfs/299, it named projid #0 to "root", and add "root" quota output<br>
> > into golden image. That's another way to deal with this bug. Maybe better?<br>
><br>
> I really think that a single, common filter function for a common form<br>
> of output makes more sense than expecting each test to handle it on a<br>
> case-by-case basis.</p>
<p dir="ltr">Hmm, I can't find more reason to refute this. So l'll follow your suggestion and send the v2 patch soon :)</p>
<p dir="ltr">Thanks,<br>
Zorro<br>
><br>
> -Eric<br>
><br>
> > Thanks,<br>
> > Zorro<br>
><br>
> _______________________________________________<br>
> xfs mailing list<br>
> <a href="mailto:xfs@oss.sgi.com">xfs@oss.sgi.com</a><br>
> <a href="http://oss.sgi.com/mailman/listinfo/xfs">http://oss.sgi.com/mailman/listinfo/xfs</a><br>
</p>