Commit 8e320d02 authored by Linus Torvalds's avatar Linus Torvalds

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.
parents 5d6700ea 303a0e11
...@@ -123,6 +123,7 @@ static void * r1buf_pool_alloc(gfp_t gfp_flags, void *data) ...@@ -123,6 +123,7 @@ static void * r1buf_pool_alloc(gfp_t gfp_flags, void *data)
goto out_free_pages; goto out_free_pages;
bio->bi_io_vec[i].bv_page = page; bio->bi_io_vec[i].bv_page = page;
bio->bi_vcnt = i+1;
} }
} }
/* If not user-requests, copy the page pointers to all bios */ /* 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) ...@@ -138,9 +139,9 @@ static void * r1buf_pool_alloc(gfp_t gfp_flags, void *data)
return r1_bio; return r1_bio;
out_free_pages: out_free_pages:
for (i=0; i < RESYNC_PAGES ; i++) for (j=0 ; j < pi->raid_disks; j++)
for (j=0 ; j < pi->raid_disks; j++) for (i=0; i < r1_bio->bios[j]->bi_vcnt ; i++)
safe_put_page(r1_bio->bios[j]->bi_io_vec[i].bv_page); put_page(r1_bio->bios[j]->bi_io_vec[i].bv_page);
j = -1; j = -1;
out_free_bio: out_free_bio:
while ( ++j < pi->raid_disks ) while ( ++j < pi->raid_disks )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment