From: Jes.Sorensen@redhat.com
To: neilb@suse.de
Cc: linux-raid@vger.kernel.org, xni@redhat.com,
William.Kuzeja@stratus.com, nate.dailey@stratus.com
Subject: [PATCH 2/2] md/raid10: Do not clear bitmap bit if submit_bio_wait() fails
Date: Thu, 22 Oct 2015 12:01:32 -0400 [thread overview]
Message-ID: <1445529692-5385-2-git-send-email-Jes.Sorensen@redhat.com> (raw)
In-Reply-To: <1445529692-5385-1-git-send-email-Jes.Sorensen@redhat.com>
In-Reply-To: <wrfjpp06lws6.fsf@redhat.com>
From: Jes Sorensen <Jes.Sorensen@redhat.com>
If submit_bio_wait fails(), we should always set 'ok' to 0, as this
means the write failed. This way the bitmap bit won't be cleared and
the chunk will eventually be resynced.
This is a slightly modified version of a patch provided by Nate
Dailey for drivers/md/raid1.c.
Reported-by: Nate Dailey <nate.dailey@stratus.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
drivers/md/raid10.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 3afce75..c1adcd3 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -2470,11 +2470,11 @@ static int narrow_write_error(struct r10bio *r10_bio, int i)
choose_data_offset(r10_bio, rdev) +
(sector - r10_bio->sector));
wbio->bi_bdev = rdev->bdev;
- if (submit_bio_wait(WRITE, wbio) < 0)
+ if (submit_bio_wait(WRITE, wbio) < 0) {
/* Failure! */
- ok = rdev_set_badblocks(rdev, sector,
- sectors, 0)
- && ok;
+ ok = 0;
+ rdev_set_badblocks(rdev, sector, sectors, 0);
+ }
bio_put(wbio);
sect_to_write -= sectors;
--
2.4.3
next prev parent reply other threads:[~2015-10-22 16:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-20 16:09 [PATCH 0/2] raid1/10: Handle write errors correctly in narrow_write_error() Jes.Sorensen
2015-10-20 16:09 ` [PATCH 1/2] md/raid1: submit_bio_wait() returns 0 on success Jes.Sorensen
2015-10-20 16:09 ` [PATCH 2/2] md/raid10: " Jes.Sorensen
2015-10-20 20:29 ` [PATCH 0/2] raid1/10: Handle write errors correctly in narrow_write_error() Neil Brown
2015-10-20 23:12 ` Jes Sorensen
2015-10-22 15:59 ` Jes Sorensen
2015-10-22 16:01 ` [PATCH 1/2] md/raid1: Do not clear bitmap bit if submit_bio_wait() fails Jes.Sorensen
2015-10-22 16:01 ` Jes.Sorensen [this message]
2015-10-22 21:36 ` [PATCH 0/2] raid1/10: Handle write errors correctly in narrow_write_error() Neil Brown
2015-10-22 22:37 ` Nate Dailey
2015-10-23 0:09 ` Neil Brown
2015-10-23 14:30 ` Nate Dailey
2015-10-23 18:02 ` Jes Sorensen
2015-10-24 5:31 ` Neil Brown
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=1445529692-5385-2-git-send-email-Jes.Sorensen@redhat.com \
--to=jes.sorensen@redhat.com \
--cc=William.Kuzeja@stratus.com \
--cc=linux-raid@vger.kernel.org \
--cc=nate.dailey@stratus.com \
--cc=neilb@suse.de \
--cc=xni@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).