public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Mahoney <jeffm@suse.com>
To: xfs@oss.sgi.com
Subject: [PATCH] xfs: Fix re-use of EWOULDBLOCK during read on dm-mirror
Date: Thu, 06 Dec 2012 17:39:17 -0500	[thread overview]
Message-ID: <50C11E95.4050502@suse.com> (raw)

When using lvconvert to convert a linear mapping to a dm-raid1 mirror,
we encountered issues where the log would be flooded with messages like:

metadata I/O error: block 0xee7060 ("xfs_trans_read_buf") error 11 numblks 8

The cause is that dm-mirror (and striping, and others) will return
-EWOULDBLOCK for readahead requests while the mirror is rebuilding. XFS's
end_io routine caches the errno and then xfs_buf_iowait bails out early
when it encounters it after issuing the i/o request. The I/O eventually
succeeds and the endio routine resets bp->b_error, but the original read
request has already returned -EWOULDBLOCK to the user and added the log
message above to the kernel log, freaking everyone out.

This patch ignores EWOULDBLOCK when deciding whether to wait for the I/O
to complete and tries again, allowing the read to succeed as expected.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
---
 fs/xfs/xfs_buf.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -1252,7 +1252,7 @@ xfs_buf_iowait(
 {
 	trace_xfs_buf_iowait(bp, _RET_IP_);
 
-	if (!bp->b_error)
+	if (!bp->b_error || bp->b_error == EWOULDBLOCK)
 		wait_for_completion(&bp->b_iowait);
 
 	trace_xfs_buf_iowait_done(bp, _RET_IP_);


-- 
Jeff Mahoney
SUSE Labs

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

             reply	other threads:[~2012-12-06 22:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-06 22:39 Jeff Mahoney [this message]
2012-12-07  9:53 ` [PATCH] xfs: Fix re-use of EWOULDBLOCK during read on dm-mirror Dave Chinner
2012-12-10  1:12   ` 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=50C11E95.4050502@suse.com \
    --to=jeffm@suse.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