From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: xfs <linux-xfs@vger.kernel.org>
Subject: [PATCH] xfs_scrub: don't try to scan xattrs if bstat says there aren't any
Date: Wed, 21 Feb 2018 18:16:49 -0800 [thread overview]
Message-ID: <20180222021649.GB9827@magnolia> (raw)
From: Darrick J. Wong <darrick.wong@oracle.com>
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>
---
scrub/phase5.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/scrub/phase5.c b/scrub/phase5.c
index 703b279..aafa036 100644
--- a/scrub/phase5.c
+++ b/scrub/phase5.c
@@ -259,9 +259,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)) {
reply other threads:[~2018-02-22 2:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180222021649.GB9827@magnolia \
--to=darrick.wong@oracle.com \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).