md/raid10: fix failure when trying to repair a read error.
commit 58c54fcca3
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>
This commit is contained in:
@@ -2310,7 +2310,7 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10
|
|||||||
if (r10_sync_page_io(rdev,
|
if (r10_sync_page_io(rdev,
|
||||||
r10_bio->devs[sl].addr +
|
r10_bio->devs[sl].addr +
|
||||||
sect,
|
sect,
|
||||||
s<<9, conf->tmppage, WRITE)
|
s, conf->tmppage, WRITE)
|
||||||
== 0) {
|
== 0) {
|
||||||
/* Well, this device is dead */
|
/* Well, this device is dead */
|
||||||
printk(KERN_NOTICE
|
printk(KERN_NOTICE
|
||||||
@@ -2349,7 +2349,7 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10
|
|||||||
switch (r10_sync_page_io(rdev,
|
switch (r10_sync_page_io(rdev,
|
||||||
r10_bio->devs[sl].addr +
|
r10_bio->devs[sl].addr +
|
||||||
sect,
|
sect,
|
||||||
s<<9, conf->tmppage,
|
s, conf->tmppage,
|
||||||
READ)) {
|
READ)) {
|
||||||
case 0:
|
case 0:
|
||||||
/* Well, this device is dead */
|
/* Well, this device is dead */
|
||||||
@@ -2512,7 +2512,7 @@ read_more:
|
|||||||
slot = r10_bio->read_slot;
|
slot = r10_bio->read_slot;
|
||||||
printk_ratelimited(
|
printk_ratelimited(
|
||||||
KERN_ERR
|
KERN_ERR
|
||||||
"md/raid10:%s: %s: redirecting"
|
"md/raid10:%s: %s: redirecting "
|
||||||
"sector %llu to another mirror\n",
|
"sector %llu to another mirror\n",
|
||||||
mdname(mddev),
|
mdname(mddev),
|
||||||
bdevname(rdev->bdev, b),
|
bdevname(rdev->bdev, b),
|
||||||
|
Reference in New Issue
Block a user