From a73fba52ca5d44ba5e79c0ed72198af65befc7bc Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 26 Jun 2006 00:27:35 -0700 Subject: [PATCH] --- yaml --- r: 30355 b: refs/heads/master c: c70810b327a247d12805554d0aa4605e257effb8 h: refs/heads/master i: 30353: e6974425bcb5166fb034146a45018c2e4edc3a5a 30351: fbca1e50781f7e17d47f19017989c42877d3076f v: v3 --- [refs] | 2 +- trunk/drivers/md/raid1.c | 34 +++++++++++++++++----------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/[refs] b/[refs] index 22757f83f974..7b26eee5d146 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 72d9486169a2a8353e022813185ba2f32d7dde69 +refs/heads/master: c70810b327a247d12805554d0aa4605e257effb8 diff --git a/trunk/drivers/md/raid1.c b/trunk/drivers/md/raid1.c index 4070eff6f0f8..4dd53fcb791a 100644 --- a/trunk/drivers/md/raid1.c +++ b/trunk/drivers/md/raid1.c @@ -374,26 +374,26 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int * already. */ if (atomic_dec_and_test(&r1_bio->remaining)) { - if (test_bit(R1BIO_BarrierRetry, &r1_bio->state)) { + if (test_bit(R1BIO_BarrierRetry, &r1_bio->state)) reschedule_retry(r1_bio); - goto out; - } - /* it really is the end of this request */ - if (test_bit(R1BIO_BehindIO, &r1_bio->state)) { - /* free extra copy of the data pages */ - int i = bio->bi_vcnt; - while (i--) - safe_put_page(bio->bi_io_vec[i].bv_page); + else { + /* it really is the end of this request */ + if (test_bit(R1BIO_BehindIO, &r1_bio->state)) { + /* free extra copy of the data pages */ + int i = bio->bi_vcnt; + while (i--) + safe_put_page(bio->bi_io_vec[i].bv_page); + } + /* clear the bitmap if all writes complete successfully */ + bitmap_endwrite(r1_bio->mddev->bitmap, r1_bio->sector, + r1_bio->sectors, + !test_bit(R1BIO_Degraded, &r1_bio->state), + behind); + md_write_end(r1_bio->mddev); + raid_end_bio_io(r1_bio); } - /* clear the bitmap if all writes complete successfully */ - bitmap_endwrite(r1_bio->mddev->bitmap, r1_bio->sector, - r1_bio->sectors, - !test_bit(R1BIO_Degraded, &r1_bio->state), - behind); - md_write_end(r1_bio->mddev); - raid_end_bio_io(r1_bio); } - out: + if (to_put) bio_put(to_put);