]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_scrub: don't try to scan xattrs if bstat says there aren't any
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 9 Mar 2018 02:35:23 +0000 (20:35 -0600)
committerEric Sandeen <sandeen@redhat.com>
Fri, 9 Mar 2018 02:35:23 +0000 (20:35 -0600)
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 <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
scrub/phase5.c

index 0ef633978a22200d282cf897fc8e241442b6eeb3..8e0a1be974d607d956716af07d2a4560d2ec2423 100644 (file)
@@ -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)) {