diff options
| -rw-r--r-- | drivers/md/raid1.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 4070eff6f0f8..4dd53fcb791a 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
| @@ -374,26 +374,26 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int | |||
| 374 | * already. | 374 | * already. |
| 375 | */ | 375 | */ |
| 376 | if (atomic_dec_and_test(&r1_bio->remaining)) { | 376 | if (atomic_dec_and_test(&r1_bio->remaining)) { |
| 377 | if (test_bit(R1BIO_BarrierRetry, &r1_bio->state)) { | 377 | if (test_bit(R1BIO_BarrierRetry, &r1_bio->state)) |
| 378 | reschedule_retry(r1_bio); | 378 | reschedule_retry(r1_bio); |
| 379 | goto out; | 379 | else { |
| 380 | } | 380 | /* it really is the end of this request */ |
| 381 | /* it really is the end of this request */ | 381 | if (test_bit(R1BIO_BehindIO, &r1_bio->state)) { |
| 382 | if (test_bit(R1BIO_BehindIO, &r1_bio->state)) { | 382 | /* free extra copy of the data pages */ |
| 383 | /* free extra copy of the data pages */ | 383 | int i = bio->bi_vcnt; |
| 384 | int i = bio->bi_vcnt; | 384 | while (i--) |
| 385 | while (i--) | 385 | safe_put_page(bio->bi_io_vec[i].bv_page); |
| 386 | safe_put_page(bio->bi_io_vec[i].bv_page); | 386 | } |
| 387 | /* clear the bitmap if all writes complete successfully */ | ||
| 388 | bitmap_endwrite(r1_bio->mddev->bitmap, r1_bio->sector, | ||
| 389 | r1_bio->sectors, | ||
| 390 | !test_bit(R1BIO_Degraded, &r1_bio->state), | ||
| 391 | behind); | ||
| 392 | md_write_end(r1_bio->mddev); | ||
| 393 | raid_end_bio_io(r1_bio); | ||
| 387 | } | 394 | } |
| 388 | /* clear the bitmap if all writes complete successfully */ | ||
| 389 | bitmap_endwrite(r1_bio->mddev->bitmap, r1_bio->sector, | ||
| 390 | r1_bio->sectors, | ||
| 391 | !test_bit(R1BIO_Degraded, &r1_bio->state), | ||
| 392 | behind); | ||
| 393 | md_write_end(r1_bio->mddev); | ||
| 394 | raid_end_bio_io(r1_bio); | ||
| 395 | } | 395 | } |
| 396 | out: | 396 | |
| 397 | if (to_put) | 397 | if (to_put) |
| 398 | bio_put(to_put); | 398 | bio_put(to_put); |
| 399 | 399 | ||
