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

Christoph Hellwig
2023-11-23T06:30:15Z

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?

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