diff options
Diffstat (limited to 'drivers/md/raid10.c')
-rw-r--r-- | drivers/md/raid10.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 957a719e8c2f..df7b0a06b0ea 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
@@ -2290,12 +2290,18 @@ static void recovery_request_write(struct mddev *mddev, struct r10bio *r10_bio) | |||
2290 | d = r10_bio->devs[1].devnum; | 2290 | d = r10_bio->devs[1].devnum; |
2291 | wbio = r10_bio->devs[1].bio; | 2291 | wbio = r10_bio->devs[1].bio; |
2292 | wbio2 = r10_bio->devs[1].repl_bio; | 2292 | wbio2 = r10_bio->devs[1].repl_bio; |
2293 | /* Need to test wbio2->bi_end_io before we call | ||
2294 | * generic_make_request as if the former is NULL, | ||
2295 | * the latter is free to free wbio2. | ||
2296 | */ | ||
2297 | if (wbio2 && !wbio2->bi_end_io) | ||
2298 | wbio2 = NULL; | ||
2293 | if (wbio->bi_end_io) { | 2299 | if (wbio->bi_end_io) { |
2294 | atomic_inc(&conf->mirrors[d].rdev->nr_pending); | 2300 | atomic_inc(&conf->mirrors[d].rdev->nr_pending); |
2295 | md_sync_acct(conf->mirrors[d].rdev->bdev, bio_sectors(wbio)); | 2301 | md_sync_acct(conf->mirrors[d].rdev->bdev, bio_sectors(wbio)); |
2296 | generic_make_request(wbio); | 2302 | generic_make_request(wbio); |
2297 | } | 2303 | } |
2298 | if (wbio2 && wbio2->bi_end_io) { | 2304 | if (wbio2) { |
2299 | atomic_inc(&conf->mirrors[d].replacement->nr_pending); | 2305 | atomic_inc(&conf->mirrors[d].replacement->nr_pending); |
2300 | md_sync_acct(conf->mirrors[d].replacement->bdev, | 2306 | md_sync_acct(conf->mirrors[d].replacement->bdev, |
2301 | bio_sectors(wbio2)); | 2307 | bio_sectors(wbio2)); |