From: Darrick J. Wong Date: Wed, 12 Apr 2023 02:00:35 +0000 (-0700) Subject: xfs: don't load local xattr values during scrub X-Git-Tag: microblaze-v6.6~486^2~15^2 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=44af6c7e59b12d740809cf25a60c9f90f03e6d20;p=linux-2.6-microblaze.git 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 Reviewed-by: Dave Chinner --- 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 @@ -200,6 +200,14 @@ xchk_xattr_listent( goto fail_xref; } + /* + * 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