Skip to content

Commit

Permalink
md/raid10: fix failure when trying to repair a read error.
Browse files Browse the repository at this point in the history
commit 58c54fc
     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: [email protected]
Reported-by: Christian Balzer <[email protected]>
Signed-off-by: NeilBrown <[email protected]>
  • Loading branch information
neilbrown committed Jul 3, 2012
1 parent 5f066c6 commit 055d374
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/md/raid10.c
Original file line number Diff line number Diff line change
Expand Up @@ -2310,7 +2310,7 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10
if (r10_sync_page_io(rdev,
r10_bio->devs[sl].addr +
sect,
s<<9, conf->tmppage, WRITE)
s, conf->tmppage, WRITE)
== 0) {
/* Well, this device is dead */
printk(KERN_NOTICE
Expand Down Expand Up @@ -2349,7 +2349,7 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10
switch (r10_sync_page_io(rdev,
r10_bio->devs[sl].addr +
sect,
s<<9, conf->tmppage,
s, conf->tmppage,
READ)) {
case 0:
/* Well, this device is dead */
Expand Down Expand Up @@ -2512,7 +2512,7 @@ static void handle_read_error(struct mddev *mddev, struct r10bio *r10_bio)
slot = r10_bio->read_slot;
printk_ratelimited(
KERN_ERR
"md/raid10:%s: %s: redirecting"
"md/raid10:%s: %s: redirecting "
"sector %llu to another mirror\n",
mdname(mddev),
bdevname(rdev->bdev, b),
Expand Down

0 comments on commit 055d374

Please sign in to comment.