All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 7/9] xfs: abort directory parent scrub scans if we encounter a zapped directory
Date: Wed, 6 Dec 2023 22:03:36 -0800	[thread overview]
Message-ID: <ZXFgOMVapbhQrSh2@infradead.org> (raw)
In-Reply-To: <170191666222.1182270.11568535367691161509.stgit@frogsfrogsfrogs>

> +/*
> + * Decide if this directory has been zapped to satisfy the inode and ifork
> + * verifiers.  Checking and repairing should be postponed until the directory
> + * is fixed.
> + */
> +bool
> +xchk_dir_looks_zapped(
> +	struct xfs_inode	*dp)
> +{
> +	/* Repair zapped this dir's data fork a short time ago */
> +	if (xfs_ifork_zapped(dp, XFS_DATA_FORK))
> +		return true;
> +
> +	/*
> +	 * If the dinode repair found a bad data fork, it will reset the fork
> +	 * to extents format with zero records and wait for the bmapbtd
> +	 * scrubber to reconstruct the block mappings.  Directories always
> +	 * contain some content, so this is a clear sign of a zapped directory.
> +	 */
> +	return dp->i_df.if_format == XFS_DINODE_FMT_EXTENTS &&
> +	       dp->i_df.if_nextents == 0;

Correct me if I'm wrong:  in general the xfs_ifork_zapped should be
all that's needed here now, and the check below just finds another
obvious case if we crashed / unmounted and lost the zapped flag?
If so maybe update the comment a bit.

Otherwise:

Reviewed-by: Christoph Hellwig <hch@lst.de>

  reply	other threads:[~2023-12-07  6:03 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07  2:38 [PATCHSET v28.1 0/9] xfs: online repair of inodes and forks Darrick J. Wong
2023-12-07  2:41 ` [PATCH 1/9] xfs: disable online repair quota helpers when quota not enabled Darrick J. Wong
2023-12-07  2:42 ` [PATCH 2/9] xfs: try to attach dquots to files before repairing them Darrick J. Wong
2023-12-07  2:42 ` [PATCH 3/9] xfs: add missing nrext64 inode flag check to scrub Darrick J. Wong
2023-12-07  5:31   ` Christoph Hellwig
2023-12-07  2:42 ` [PATCH 4/9] xfs: repair inode records Darrick J. Wong
2023-12-07  5:41   ` Christoph Hellwig
2023-12-11 20:04     ` Darrick J. Wong
2023-12-12  5:36       ` Christoph Hellwig
2023-12-13  1:36         ` Darrick J. Wong
2023-12-07  2:43 ` [PATCH 5/9] xfs: zap broken inode forks Darrick J. Wong
2023-12-07  6:00   ` Christoph Hellwig
2023-12-07  6:01     ` Christoph Hellwig
2023-12-07  2:43 ` [PATCH 6/9] xfs: set inode sick state flags when we zap either ondisk fork Darrick J. Wong
2023-12-07  5:58   ` Christoph Hellwig
2023-12-11 22:48     ` Darrick J. Wong
2023-12-07  2:43 ` [PATCH 7/9] xfs: abort directory parent scrub scans if we encounter a zapped directory Darrick J. Wong
2023-12-07  6:03   ` Christoph Hellwig [this message]
2023-12-11 19:19     ` Darrick J. Wong
2023-12-07  2:43 ` [PATCH 8/9] xfs: skip the rmapbt search on an empty attr fork unless we know it was zapped Darrick J. Wong
2023-12-07  6:07   ` Christoph Hellwig
2023-12-11 22:50     ` Darrick J. Wong
2023-12-07  2:44 ` [PATCH 9/9] xfs: repair obviously broken inode modes Darrick J. Wong
2023-12-07  6:10   ` Christoph Hellwig
2023-12-11 22:19     ` Darrick J. Wong
2023-12-12  5:35       ` Christoph Hellwig
2023-12-13  1:04         ` Darrick J. Wong

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=ZXFgOMVapbhQrSh2@infradead.org \
    --to=hch@infradead.org \
    --cc=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.