aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r--drivers/md/raid1.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 7b4f5f7155d..e2466425d9c 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1237,8 +1237,9 @@ static void end_sync_write(struct bio *bio, int error)
1237 update_head_pos(mirror, r1_bio); 1237 update_head_pos(mirror, r1_bio);
1238 1238
1239 if (atomic_dec_and_test(&r1_bio->remaining)) { 1239 if (atomic_dec_and_test(&r1_bio->remaining)) {
1240 md_done_sync(mddev, r1_bio->sectors, uptodate); 1240 sector_t s = r1_bio->sectors;
1241 put_buf(r1_bio); 1241 put_buf(r1_bio);
1242 md_done_sync(mddev, s, uptodate);
1242 } 1243 }
1243} 1244}
1244 1245
@@ -1640,7 +1641,8 @@ static void raid1d(mddev_t *mddev)
1640 } 1641 }
1641 1642
1642 bio = r1_bio->bios[r1_bio->read_disk]; 1643 bio = r1_bio->bios[r1_bio->read_disk];
1643 if ((disk=read_balance(conf, r1_bio)) == -1) { 1644 if ((disk=read_balance(conf, r1_bio)) == -1 ||
1645 disk == r1_bio->read_disk) {
1644 printk(KERN_ALERT "raid1: %s: unrecoverable I/O" 1646 printk(KERN_ALERT "raid1: %s: unrecoverable I/O"
1645 " read error for block %llu\n", 1647 " read error for block %llu\n",
1646 bdevname(bio->bi_bdev,b), 1648 bdevname(bio->bi_bdev,b),