md/raid1: minor bio initialisation improvements.
authorNeilBrown <neilb@suse.de>
Thu, 7 Oct 2010 01:00:50 +0000 (12:00 +1100)
committerNeilBrown <neilb@suse.de>
Thu, 7 Oct 2010 01:00:50 +0000 (12:00 +1100)
When performing a resync we pre-allocate some bios and repeatedly use
them.  This requires us to re-initialise them each time.
One field (bi_comp_cpu) and some flags weren't being initiaised
reliably.

Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid1.c

index fba4d2feaeb4ae2f0bf56a4c097c653049915f14..0b830bbe1d8b6323bac02106c2ccc4d806e1e390 100644 (file)
@@ -1839,7 +1839,9 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
 
                /* take from bio_init */
                bio->bi_next = NULL;
+               bio->bi_flags &= ~(BIO_POOL_MASK-1);
                bio->bi_flags |= 1 << BIO_UPTODATE;
+               bio->bi_comp_cpu = -1;
                bio->bi_rw = READ;
                bio->bi_vcnt = 0;
                bio->bi_idx = 0;