Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

+4 -3
+4 -3
drivers/md/raid1.c
··· 123 123 goto out_free_pages; 124 124 125 125 bio->bi_io_vec[i].bv_page = page; 126 + bio->bi_vcnt = i+1; 126 127 } 127 128 } 128 129 /* If not user-requests, copy the page pointers to all bios */ ··· 139 138 return r1_bio; 140 139 141 140 out_free_pages: 142 - for (i=0; i < RESYNC_PAGES ; i++) 143 - for (j=0 ; j < pi->raid_disks; j++) 144 - safe_put_page(r1_bio->bios[j]->bi_io_vec[i].bv_page); 141 + for (j=0 ; j < pi->raid_disks; j++) 142 + for (i=0; i < r1_bio->bios[j]->bi_vcnt ; i++) 143 + put_page(r1_bio->bios[j]->bi_io_vec[i].bv_page); 145 144 j = -1; 146 145 out_free_bio: 147 146 while ( ++j < pi->raid_disks )