aboutsummaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-04-06 13:46:27 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-06 13:46:27 -0700
commit8e320d02718d2872d52ef88a69a493e420494269 (patch)
tree13f33e94375ae53e235454706642c6e01b258155 /drivers/md
parent5d6700ea7bfb4704a8d5d10c6ebf0e947410f9ce (diff)
parent303a0e11d0ee136ad8f53f747f3c377daece763b (diff)
Merge branch 'for-linus' of git://neil.brown.name/md
* 'for-linus' of git://neil.brown.name/md: md/raid1 - don't assume newly allocated bvecs are initialised.
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/raid1.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index b4f4badc006..f2247b0cd1a 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -123,6 +123,7 @@ static void * r1buf_pool_alloc(gfp_t gfp_flags, void *data)
goto out_free_pages;
bio->bi_io_vec[i].bv_page = page;
+ bio->bi_vcnt = i+1;
}
}
/* If not user-requests, copy the page pointers to all bios */
@@ -138,9 +139,9 @@ static void * r1buf_pool_alloc(gfp_t gfp_flags, void *data)
return r1_bio;
out_free_pages:
- for (i=0; i < RESYNC_PAGES ; i++)
- for (j=0 ; j < pi->raid_disks; j++)
- safe_put_page(r1_bio->bios[j]->bi_io_vec[i].bv_page);
+ for (j=0 ; j < pi->raid_disks; j++)
+ for (i=0; i < r1_bio->bios[j]->bi_vcnt ; i++)
+ put_page(r1_bio->bios[j]->bi_io_vec[i].bv_page);
j = -1;
out_free_bio:
while ( ++j < pi->raid_disks )