Re: [PATCH 7/8] common/attr: fix _require_noattr2

Darrick J. Wong
2025-10-20T16:27:57Z

On Sat, Oct 18, 2025 at 10:43:18PM +0800, Zorro Lang wrote:
> On Fri, Oct 17, 2025 at 03:55:46PM -0700, Darrick J. Wong wrote:
> > On Sat, Oct 18, 2025 at 01:13:25AM +0800, Zorro Lang wrote:
> > > On Wed, Oct 15, 2025 at 09:38:32AM -0700, Darrick J. Wong wrote:
> > > > From: Darrick J. Wong <djwong@kernel.org>
> > > >
> > > > attr2/noattr2 doesn't do anything anymore and aren't reported in
> > > > /proc/mounts, so we need to check /proc/mounts and _notrun as a result.
> > > >
> > > > Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
> > > > ---
> > > > common/attr | 4 ++++
> > > > 1 file changed, 4 insertions(+)
> > > >
> > > >
> > > > diff --git a/common/attr b/common/attr
> > > > index 1c1de63e9d5465..35e0bee4e3aa53 100644
> > > > --- a/common/attr
> > > > +++ b/common/attr
> > > > @@ -241,7 +241,11 @@ _require_noattr2()
> > > > || _fail "_try_scratch_mkfs_xfs failed on $SCRATCH_DEV"
> > > > _try_scratch_mount -o noattr2 > /dev/null 2>&1 \
> > > > || _notrun "noattr2 mount option not supported on $SCRATCH_DEV"
> > > > + grep -w "$SCRATCH_MNT" /proc/mounts | awk '{print $4}' | grep -q -w noattr2
> > >
> > > How about use findmnt? e.g.
> > >
> > > grep -qw noattr2 <(findmnt -rncv -M / -o OPTIONS)
>
> Sorry, the "/" should be $SCRATCH_MNT.
>
> > >
> > > > + local res=${PIPESTATUS[2]}
> > >
> > > Then the PIPESTATUS isn't needed either.
> > >
> > > I can help to do this change if you agree.
> >
> > Yes, that works! Excellent suggestion.
>
> The patch 1,2,3,5,7,8 has been acked/reviewed, do you need I merge these patches
> in the release of this weekend at first, as this's a random fixes patchset. Or
> I can wait your next version, then merge the whole patchset when it's all get
> reviewed ?

Well I guess you didn't take any of them yet, so I'll republish them in
a little bit.

--D

> Thanks,
> Zorro
>
> >
> > --D
> >
> > > Thanks,
> > > Zorro
> > >
> > > > _scratch_unmount
> > > > + test $res -eq 0 \
> > > > + || _notrun "noattr2 mount option no longer functional"
> > > > }
> > > >
> > > > # getfattr -R returns info in readdir order which varies from fs to fs.
> > > >
> > >
> > >
> >
>
>