summaryrefslogtreecommitdiff
path: root/drivers/md/raid1.c
diff options
context:
space:
mode:
authorJody McIntyre <scjody@modernduck.com>2005-12-13 07:34:32 +0300
committerJody McIntyre <scjody@modernduck.com>2005-12-13 07:34:32 +0300
commit525352eb6d355bef6adf597252fc6d04f2dbe66c (patch)
tree4d2b42372ec0ac985f2775b0ea260c707e93fdd4 /drivers/md/raid1.c
parentd51e86c18a479f1dbcef3aa20e58ad04d1233016 (diff)
parent0e670506668a43e1355b8f10c33d081a676bd521 (diff)
downloadlinux-525352eb6d355bef6adf597252fc6d04f2dbe66c.tar.xz
Merge with http://kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r--drivers/md/raid1.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 3066c587b539..229d7b204297 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -320,7 +320,6 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int
* this branch is our 'one mirror IO has finished' event handler:
*/
r1_bio->bios[mirror] = NULL;
- bio_put(bio);
if (!uptodate) {
md_error(r1_bio->mddev, conf->mirrors[mirror].rdev);
/* an I/O failed, we can't clear the bitmap */
@@ -377,7 +376,6 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int
}
if (test_bit(R1BIO_BehindIO, &r1_bio->state)) {
/* free extra copy of the data pages */
-/* FIXME bio has been freed!!! */
int i = bio->bi_vcnt;
while (i--)
__free_page(bio->bi_io_vec[i].bv_page);
@@ -391,6 +389,9 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int
raid_end_bio_io(r1_bio);
}
+ if (r1_bio->bios[mirror]==NULL)
+ bio_put(bio);
+
rdev_dec_pending(conf->mirrors[mirror].rdev, conf->mddev);
return 0;
}