]>
Commit | Line | Data |
---|---|---|
53f3a5d9 GKH |
1 | From 203d27b0226a05202438ddb39ef0ef1acb14a759 Mon Sep 17 00:00:00 2001 |
2 | From: Jes Sorensen <Jes.Sorensen@redhat.com> | |
3 | Date: Tue, 20 Oct 2015 12:09:12 -0400 | |
4 | Subject: md/raid1: submit_bio_wait() returns 0 on success | |
5 | ||
6 | From: Jes Sorensen <Jes.Sorensen@redhat.com> | |
7 | ||
8 | commit 203d27b0226a05202438ddb39ef0ef1acb14a759 upstream. | |
9 | ||
10 | This was introduced with 9e882242c6193ae6f416f2d8d8db0d9126bd996b | |
11 | which changed the return value of submit_bio_wait() to return != 0 on | |
12 | error, but didn't update the caller accordingly. | |
13 | ||
14 | Fixes: 9e882242c6 ("block: Add submit_bio_wait(), remove from md") | |
15 | Reported-by: Bill Kuzeja <William.Kuzeja@stratus.com> | |
16 | Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> | |
17 | Signed-off-by: NeilBrown <neilb@suse.com> | |
18 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
19 | ||
20 | --- | |
21 | drivers/md/raid1.c | 2 +- | |
22 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
23 | ||
24 | --- a/drivers/md/raid1.c | |
25 | +++ b/drivers/md/raid1.c | |
26 | @@ -2251,7 +2251,7 @@ static int narrow_write_error(struct r1b | |
27 | bio_trim(wbio, sector - r1_bio->sector, sectors); | |
28 | wbio->bi_iter.bi_sector += rdev->data_offset; | |
29 | wbio->bi_bdev = rdev->bdev; | |
30 | - if (submit_bio_wait(WRITE, wbio) == 0) | |
31 | + if (submit_bio_wait(WRITE, wbio) < 0) | |
32 | /* failure! */ | |
33 | ok = rdev_set_badblocks(rdev, sector, | |
34 | sectors, 0) |