From: Darrick J. Wong Date: Fri, 9 Mar 2018 02:35:23 +0000 (-0600) Subject: xfs_scrub: don't try to scan xattrs if bstat says there aren't any X-Git-Tag: v4.16.0-rc1~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e24ee6b654599b5c129994921777cc3d3ad2b420;p=thirdparty%2Fxfsprogs-dev.git xfs_scrub: don't try to scan xattrs if bstat says there aren't any Only try to scan the extended attributes of a file if bstat says that the file actually has any. Surprisingly, this reduces the phase 5 runtime by 40% if most of the files don't have attrs. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen Signed-off-by: Eric Sandeen --- diff --git a/scrub/phase5.c b/scrub/phase5.c index 0ef633978..8e0a1be97 100644 --- a/scrub/phase5.c +++ b/scrub/phase5.c @@ -256,9 +256,12 @@ xfs_scrub_connections( background_sleep(); /* Warn about naming problems in xattrs. */ - moveon = xfs_scrub_scan_fhandle_xattrs(ctx, descr, handle, bstat); - if (!moveon) - goto out; + if (bstat->bs_xflags & FS_XFLAG_HASATTR) { + moveon = xfs_scrub_scan_fhandle_xattrs(ctx, descr, handle, + bstat); + if (!moveon) + goto out; + } /* Open the dir, let the kernel try to reconnect it to the root. */ if (S_ISDIR(bstat->bs_mode)) {