linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: sandeen@sandeen.net, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 4/5] xfs_scrub: separate internal metadata scrub functions
Date: Tue, 10 Sep 2019 10:19:33 +1000	[thread overview]
Message-ID: <20190910001933.GI16973@dread.disaster.area> (raw)
In-Reply-To: <156774082719.2643094.12163874100429393033.stgit@magnolia>

On Thu, Sep 05, 2019 at 08:33:47PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Refactor xfs_scrub_metadata into two functions -- one to make a single
> call xfs_check_metadata, and the second retains the loop logic.  The
> name is a little easy to confuse with other functions, so rename it to
> reflect what it actually does: scrub all internal metadata of a given
> class (AG header, AG metadata, FS metadata).  No functional changes.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Minor nit:

> +/* Scrub non-inode metadata, saving corruption reports for later. */
> +static int
> +xfs_scrub_meta(
> +	struct scrub_ctx		*ctx,
> +	unsigned int			type,
> +	xfs_agnumber_t			agno,
> +	struct xfs_action_list		*alist)
> +{
> +	struct xfs_scrub_metadata	meta = {
> +		.sm_type		= type,
> +		.sm_agno		= agno,
> +	};

This should be called xfs_scrub_meta_type() because it only
scrubs the specific type passed into it....

>  /* Scrub metadata, saving corruption reports for later. */
>  static bool
> -xfs_scrub_metadata(
> +xfs_scrub_meta_type(
>  	struct scrub_ctx		*ctx,
>  	enum xfrog_scrub_type		scrub_type,
>  	xfs_agnumber_t			agno,
>  	struct xfs_action_list		*alist)
>  {
> -	struct xfs_scrub_metadata	meta = {0};
>  	const struct xfrog_scrub_descr	*sc;
> -	enum check_outcome		fix;
> -	int				type;
> +	unsigned int			type;
>  
>  	sc = xfrog_scrubbers;
>  	for (type = 0; type < XFS_SCRUB_TYPE_NR; type++, sc++) {
> +		int			ret;
> +

And this should be called xfs_scrub_all_metadata() because it
walks across all the metadata types in the filesystem and calls
xfs_scrub_meta_type() for each type to scrub them one by one....

Other than that, it looks fine.

Reviewed-by: Dave Chinner <dchinner@redhat.com>

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2019-09-10  0:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-06  3:33 [PATCH 0/5] xfsprogs: scrub filesystem summary counters Darrick J. Wong
2019-09-06  3:33 ` [PATCH 1/5] xfs_scrub: remove unnecessary fd parameter from file scrubbers Darrick J. Wong
2019-09-09 23:29   ` Dave Chinner
2019-09-06  3:33 ` [PATCH 2/5] libfrog: share scrub headers Darrick J. Wong
2019-09-09 23:36   ` Dave Chinner
2019-09-06  3:33 ` [PATCH 3/5] libfrog: add online scrub/repair for superblock counters Darrick J. Wong
2019-09-09 23:55   ` Dave Chinner
2019-09-06  3:33 ` [PATCH 4/5] xfs_scrub: separate internal metadata scrub functions Darrick J. Wong
2019-09-10  0:19   ` Dave Chinner [this message]
2019-09-16 21:26     ` Darrick J. Wong
2019-09-06  3:33 ` [PATCH 5/5] xfs_scrub: check summary counters Darrick J. Wong
2019-09-10  0:21   ` Dave Chinner
2019-09-25 21:31 [PATCH 0/5] xfsprogs: scrub filesystem " Darrick J. Wong
2019-09-25 21:31 ` [PATCH 4/5] xfs_scrub: separate internal metadata scrub functions Darrick J. Wong
2019-09-26 17:37   ` Eric Sandeen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190910001933.GI16973@dread.disaster.area \
    --to=david@fromorbit.com \
    --cc=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).