From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from userp2120.oracle.com ([156.151.31.85]:54030 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725788AbfGEQrS (ORCPT ); Fri, 5 Jul 2019 12:47:18 -0400 Date: Fri, 5 Jul 2019 09:46:55 -0700 From: "Darrick J. Wong" Subject: Re: [PATCH 2/6] xfs: attribute scrub should use seen_enough to pass error values Message-ID: <20190705164655.GF1404256@magnolia> References: <156158199378.495944.4088787757066517679.stgit@magnolia> <156158200593.495944.1612838829393872431.stgit@magnolia> <20190705144917.GD37448@bfoster> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190705144917.GD37448@bfoster> Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: Brian Foster Cc: linux-xfs@vger.kernel.org On Fri, Jul 05, 2019 at 10:49:17AM -0400, Brian Foster wrote: > On Wed, Jun 26, 2019 at 01:46:45PM -0700, Darrick J. Wong wrote: > > From: Darrick J. Wong > > > > When we're iterating all the attributes using the built-in xattr > > iterator, we can use the seen_enough variable to pass error codes back > > to the main scrub function instead of flattening them into 0/1. This > > will be used in a more exciting fashion in upcoming patches. > > > > Signed-off-by: Darrick J. Wong > > --- > > fs/xfs/scrub/attr.c | 8 ++++++-- > > 1 file changed, 6 insertions(+), 2 deletions(-) > > > > > > diff --git a/fs/xfs/scrub/attr.c b/fs/xfs/scrub/attr.c > > index dce74ec57038..f0fd26abd39d 100644 > > --- a/fs/xfs/scrub/attr.c > > +++ b/fs/xfs/scrub/attr.c > > @@ -83,7 +83,7 @@ xchk_xattr_listent( > > sx = container_of(context, struct xchk_xattr, context); > > > > if (xchk_should_terminate(sx->sc, &error)) { > > - context->seen_enough = 1; > > + context->seen_enough = error; > > It might be appropriate to update the xfs_attr_list_context structure > definition comment since 'seen_enough' is not self explanatory as an > error code..? Otherwise looks fine: Ok. I'll change it to: /* * Abort attribute list iteration if non-zero. Can be used to * pass error values to the xfs_attr_list caller. */ --D > Reviewed-by: Brian Foster > > > return; > > } > > > > @@ -125,7 +125,7 @@ xchk_xattr_listent( > > args.blkno); > > fail_xref: > > if (sx->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) > > - context->seen_enough = 1; > > + context->seen_enough = XFS_ITER_ABORT; > > return; > > } > > > > @@ -464,6 +464,10 @@ xchk_xattr( > > error = xfs_attr_list_int_ilocked(&sx.context); > > if (!xchk_fblock_process_error(sc, XFS_ATTR_FORK, 0, &error)) > > goto out; > > + > > + /* Did our listent function try to return any errors? */ > > + if (sx.context.seen_enough < 0) > > + error = sx.context.seen_enough; > > out: > > return error; > > } > >