From: Dave Chinner <david@fromorbit.com>
To: xfs@oss.sgi.com
Subject: [PATCH 2/4] xfs: don't look forever in xfs_inode_ag_walk during async inode flushes
Date: Thu, 21 Apr 2011 14:29:02 +1000 [thread overview]
Message-ID: <1303360144-10632-3-git-send-email-david@fromorbit.com> (raw)
In-Reply-To: <1303360144-10632-1-git-send-email-david@fromorbit.com>
From: Dave Chinner <dchinner@redhat.com>
When the underlying inode buffer is locked and xfs_sync_inode_attr()
is doing a non-blocking flush, xfs_iflush() can return EAGAIN. When
this happenѕ, clear the error rather than returning it to
xfs_inode_ag_walk(), as returning EAGAIN will result in the AG walk
delaying for a short while and trying again. This can result in
background walks getting stuck on the one AG until inode buffer is
unlocked by some other means.
This behaviour was noticed when analysing event traces followed by
code inspection and verification of the fix via further traces.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
fs/xfs/linux-2.6/xfs_sync.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c
index 7883762..3253572 100644
--- a/fs/xfs/linux-2.6/xfs_sync.c
+++ b/fs/xfs/linux-2.6/xfs_sync.c
@@ -267,6 +267,16 @@ xfs_sync_inode_attr(
error = xfs_iflush(ip, flags);
+ /*
+ * We don't want to try again on non-blocking flushes that can't run
+ * again immediately. If an inode really must be written, then that's
+ * what the SYNC_WAIT flag is for.
+ */
+ if (error == EAGAIN) {
+ ASSERT(!(flags & SYNC_WAIT));
+ error = 0;
+ }
+
out_unlock:
xfs_iunlock(ip, XFS_ILOCK_SHARED);
return error;
--
1.7.4.4
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2011-04-21 4:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-21 4:29 [PATCH 0/4] xfs: candidate fixes for 2.6.39-rc4 Dave Chinner
2011-04-21 4:29 ` [PATCH 1/4] xfs: fix xfs_itruncate_start tracing Dave Chinner
2011-04-21 4:29 ` Dave Chinner [this message]
2011-04-21 4:29 ` [PATCH 3/4] xfs: reset buffer pointers before freeing them Dave Chinner
2011-04-21 4:52 ` Christoph Hellwig
2011-04-21 6:53 ` Dave Chinner
2011-04-21 4:29 ` [PATCH 4/4] xfs: obey minleft values during extent allocation correctly Dave Chinner
2011-04-21 4:44 ` Christoph Hellwig
2011-04-21 5:05 ` Lachlan McIlroy
2011-04-21 6:53 ` Dave Chinner
2011-04-21 13:48 ` Lachlan McIlroy
2011-04-21 20:48 ` [PATCH 0/4] xfs: candidate fixes for 2.6.39-rc4 Alex Elder
-- strict thread matches above, loose matches on Subject: below --
2011-04-21 9:34 [PATCH 0/4] xfs: candidate fixes for 2.6.39-rc4 v2 Dave Chinner
2011-04-21 9:34 ` [PATCH 2/4] xfs: don't look forever in xfs_inode_ag_walk during async inode flushes Dave Chinner
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=1303360144-10632-3-git-send-email-david@fromorbit.com \
--to=david@fromorbit.com \
--cc=xfs@oss.sgi.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