summaryrefslogtreecommitdiffstats
path: root/fs/xfs/scrub/attr.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2023-04-12 04:00:35 +0200
committerDarrick J. Wong <djwong@kernel.org>2023-04-12 04:00:35 +0200
commit44af6c7e59b12d740809cf25a60c9f90f03e6d20 (patch)
treed8d67958a1fe6acdbe701888b27019b910cc2040 /fs/xfs/scrub/attr.c
parentxfs: only allocate free space bitmap for xattr scrub if needed (diff)
downloadlinux-44af6c7e59b12d740809cf25a60c9f90f03e6d20.tar.xz
linux-44af6c7e59b12d740809cf25a60c9f90f03e6d20.zip
xfs: don't load local xattr values during scrub
Local extended attributes store their values within the same leaf block. There's no header for the values themselves, nor are they separately checksummed. Hence we can save a bit of time in the attr scrubber by not wasting time retrieving the values. Regrettably, shortform attributes do not set XFS_ATTR_LOCAL so this offers us no advantage there, but at least there are very few attrs in that case. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/scrub/attr.c')
-rw-r--r--fs/xfs/scrub/attr.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/xfs/scrub/attr.c b/fs/xfs/scrub/attr.c
index 2445fe2860ff..6c16d9530cca 100644
--- a/fs/xfs/scrub/attr.c
+++ b/fs/xfs/scrub/attr.c
@@ -201,6 +201,14 @@ xchk_xattr_listent(
}
/*
+ * Local xattr values are stored in the attr leaf block, so we don't
+ * need to retrieve the value from a remote block to detect corruption
+ * problems.
+ */
+ if (flags & XFS_ATTR_LOCAL)
+ goto fail_xref;
+
+ /*
* Try to allocate enough memory to extrat the attr value. If that
* doesn't work, we overload the seen_enough variable to convey
* the error message back to the main scrub function.