diff options
author | NeilBrown <neilb@suse.de> | 2012-07-03 01:55:33 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-07-03 01:55:33 -0400 |
commit | 055d3747dbf00ce85c6872ecca4d466638e80c22 (patch) | |
tree | e58062bddc9b1770328c450c780d60e72459173e /drivers/md/raid10.c | |
parent | 5f066c632fcfd2a33f2eb7077c15c630e9f5ea5b (diff) |
md/raid10: fix failure when trying to repair a read error.
commit 58c54fcca3bac5bf9290cfed31c76e4c4bfbabaf
md/raid10: handle further errors during fix_read_error better.
in 3.1 added "r10_sync_page_io" which takes an IO size in sectors.
But we were passing the IO size in bytes!!!
This resulting in bio_add_page failing, and empty request being sent
down, and a consequent BUG_ON in scsi_lib.
[fix missing space in error message at same time]
This fix is suitable for 3.1.y and later.
Cc: stable@vger.kernel.org
Reported-by: Christian Balzer <chibi@gol.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid10.c')
-rw-r--r-- | drivers/md/raid10.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index bcf6ea8acc9f..ae73e29298b2 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
@@ -2310,7 +2310,7 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10 | |||
2310 | if (r10_sync_page_io(rdev, | 2310 | if (r10_sync_page_io(rdev, |
2311 | r10_bio->devs[sl].addr + | 2311 | r10_bio->devs[sl].addr + |
2312 | sect, | 2312 | sect, |
2313 | s<<9, conf->tmppage, WRITE) | 2313 | s, conf->tmppage, WRITE) |
2314 | == 0) { | 2314 | == 0) { |
2315 | /* Well, this device is dead */ | 2315 | /* Well, this device is dead */ |
2316 | printk(KERN_NOTICE | 2316 | printk(KERN_NOTICE |
@@ -2349,7 +2349,7 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10 | |||
2349 | switch (r10_sync_page_io(rdev, | 2349 | switch (r10_sync_page_io(rdev, |
2350 | r10_bio->devs[sl].addr + | 2350 | r10_bio->devs[sl].addr + |
2351 | sect, | 2351 | sect, |
2352 | s<<9, conf->tmppage, | 2352 | s, conf->tmppage, |
2353 | READ)) { | 2353 | READ)) { |
2354 | case 0: | 2354 | case 0: |
2355 | /* Well, this device is dead */ | 2355 | /* Well, this device is dead */ |
@@ -2512,7 +2512,7 @@ read_more: | |||
2512 | slot = r10_bio->read_slot; | 2512 | slot = r10_bio->read_slot; |
2513 | printk_ratelimited( | 2513 | printk_ratelimited( |
2514 | KERN_ERR | 2514 | KERN_ERR |
2515 | "md/raid10:%s: %s: redirecting" | 2515 | "md/raid10:%s: %s: redirecting " |
2516 | "sector %llu to another mirror\n", | 2516 | "sector %llu to another mirror\n", |
2517 | mdname(mddev), | 2517 | mdname(mddev), |
2518 | bdevname(rdev->bdev, b), | 2518 | bdevname(rdev->bdev, b), |