Re: [PATCH 1/4] xfs_io: support passing the FORCE_REBUILD flag to online repair

Darrick J. Wong
2023-11-27T18:54:05Z

On Wed, Nov 22, 2023 at 10:30:11PM -0800, Christoph Hellwig wrote:
> On Wed, Nov 22, 2023 at 03:07:48PM -0800, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> >
> > Add CLI options to the scrubv and repair commands so that the user can
> > pass FORCE_REBUILD to force the kernel to rebuild metadata.
> >
> > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> > Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
>
> I guess on it's own this looks fine:
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
>
> Howerver I find the code structure here a bit odd and rather hard
> to follow. Why can't parse_args actually just do the parsing
> and return control, control2 and flags the caller and let do the
> work?

Sounds like a reasonable cleanup.

> While we're at it, shouldn't all the validation errors in parse_args
> set exitcode to 1?

Yes, they should. I'll add a new patch to fix that.

--D

>