Re: [PATCH 7/9] xfs: abort directory parent scrub scans if we encounter a zapped directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +/*
> + * 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@xxxxxx>




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux