diff mbox series

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

Message ID 170404991231.1793698.14185413593373261700.stgit@frogsfrogsfrogs (mailing list archive)
State Superseded
Headers show
Series [1/8] xfs_db: add a bmbt inflation command | expand

Commit Message

Darrick J. Wong Dec. 31, 2023, 10:10 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

Repair only queries inode block maps for inode forks that map filesystem
metadata.  IOWs, it only uses it for directories, quota files, symlinks,
and extended attributes.  It doesn't use it for regular files or
realtime files, so exclude its use for these files to reduce processing
times for heavily fragmented regular files.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 repair/dinode.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/repair/dinode.c b/repair/dinode.c
index a6a44b85424..f2961275cd1 100644
--- a/repair/dinode.c
+++ b/repair/dinode.c
@@ -1929,8 +1929,8 @@  process_inode_data_fork(
 	if (*nextents > be64_to_cpu(dino->di_nblocks))
 		*nextents = 1;
 
-
-	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))
 		*dblkmap = blkmap_alloc(*nextents, XFS_DATA_FORK);
 	*nextents = 0;