aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/raid1.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 55ccf4730536..e913356b257e 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -333,9 +333,10 @@ static void raid1_end_read_request(struct bio *bio, int error)
333 spin_unlock_irqrestore(&conf->device_lock, flags); 333 spin_unlock_irqrestore(&conf->device_lock, flags);
334 } 334 }
335 335
336 if (uptodate) 336 if (uptodate) {
337 raid_end_bio_io(r1_bio); 337 raid_end_bio_io(r1_bio);
338 else { 338 rdev_dec_pending(conf->mirrors[mirror].rdev, conf->mddev);
339 } else {
339 /* 340 /*
340 * oops, read error: 341 * oops, read error:
341 */ 342 */
@@ -349,9 +350,8 @@ static void raid1_end_read_request(struct bio *bio, int error)
349 (unsigned long long)r1_bio->sector); 350 (unsigned long long)r1_bio->sector);
350 set_bit(R1BIO_ReadError, &r1_bio->state); 351 set_bit(R1BIO_ReadError, &r1_bio->state);
351 reschedule_retry(r1_bio); 352 reschedule_retry(r1_bio);
353 /* don't drop the reference on read_disk yet */
352 } 354 }
353
354 rdev_dec_pending(conf->mirrors[mirror].rdev, conf->mddev);
355} 355}
356 356
357static void close_write(struct r1bio *r1_bio) 357static void close_write(struct r1bio *r1_bio)
@@ -2229,6 +2229,7 @@ static void handle_read_error(struct r1conf *conf, struct r1bio *r1_bio)
2229 unfreeze_array(conf); 2229 unfreeze_array(conf);
2230 } else 2230 } else
2231 md_error(mddev, conf->mirrors[r1_bio->read_disk].rdev); 2231 md_error(mddev, conf->mirrors[r1_bio->read_disk].rdev);
2232 rdev_dec_pending(conf->mirrors[r1_bio->read_disk].rdev, conf->mddev);
2232 2233
2233 bio = r1_bio->bios[r1_bio->read_disk]; 2234 bio = r1_bio->bios[r1_bio->read_disk];
2234 bdevname(bio->bi_bdev, b); 2235 bdevname(bio->bi_bdev, b);