Re: [PATCH 7/8] xfs_repair: don't create block maps for data files

Darrick J. Wong
2024-03-15T00:02:57Z

On Wed, Mar 13, 2024 at 07:05:26PM -0700, Christoph Hellwig wrote:
> On Tue, Mar 12, 2024 at 07:16:29PM -0700, Darrick J. Wong wrote:
> > -
> > - if (dino->di_format != XFS_DINODE_FMT_LOCAL && type != XR_INO_RTDATA)
> > + if (dino->di_format != XFS_DINODE_FMT_LOCAL &&
> > + (type != XR_INO_RTDATA && type != XR_INO_DATA))
>
> Maybe throw a comment in here? Or even add a little helper with the
> comment?

/*
* Repair doesn't care about the block maps for regular file data
* because it never tries to read data blocks. Only spend time on
* constructing a block map for directories, quota files, symlinks,
* and realtime space metadata.
*/
if (dino->di_format != XFS_DINODE_FMT_LOCAL &&
(type != XR_INO_RTDATA && type != XR_INO_DATA))
*dblkmap = blkmap_alloc(*nextents, XFS_DATA_FORK);

I'll change the commit message too.

--D

> The logic change itself looks fine.
>