On Wed, Dec 06, 2023 at 10:03:36PM -0800, Christoph Hellwig wrote: > > +/* > > + * 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. Correct. The comment now reads: /* * 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. * The state checked by xfs_ifork_zapped is not persisted, so this is * our backup strategy if repairs are interrupted by a crash or an * unmount. */ > Otherwise: > > Reviewed-by: Christoph Hellwig <hch@xxxxxx> Thanks! --D