diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2018-03-08 20:35:23 -0600 |
---|---|---|
committer | Eric Sandeen <sandeen@redhat.com> | 2018-03-08 20:35:23 -0600 |
commit | e24ee6b654599b5c129994921777cc3d3ad2b420 (patch) | |
tree | 242c7c6da37ae809fadb09d22b5b026b37c8113c | |
parent | a440f87737944bc2b4f1ce0b4dae7698703f0fdc (diff) | |
download | xfsprogs-dev-e24ee6b654599b5c129994921777cc3d3ad2b420.tar.gz |
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 <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
-rw-r--r-- | scrub/phase5.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/scrub/phase5.c b/scrub/phase5.c index 0ef633978a..8e0a1be974 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)) { |