Commit a63ca30f authored by Angus Sawyer's avatar Angus Sawyer Committed by Linus Torvalds

[PATCH] Fix for raid1 against 2.5.43

A cloned bio still needs destructor set (and should clear bi_io_vec as
well), this was broken when Jens rewrote bio_alloc() recently.

This should now be OK with the mempool_alloc failing, and initialises
bi_io_vec = NULL for nr_iovecs = 0.
parent 7e8a4852
...@@ -149,12 +149,13 @@ struct bio *bio_alloc(int gfp_mask, int nr_iovecs) ...@@ -149,12 +149,13 @@ struct bio *bio_alloc(int gfp_mask, int nr_iovecs)
bio_init(bio); bio_init(bio);
if (unlikely(!nr_iovecs)) if (unlikely(!nr_iovecs))
goto out; goto noiovec;
bvl = bvec_alloc(gfp_mask, nr_iovecs, &idx); bvl = bvec_alloc(gfp_mask, nr_iovecs, &idx);
if (bvl) { if (bvl) {
bio->bi_flags |= idx << BIO_POOL_OFFSET; bio->bi_flags |= idx << BIO_POOL_OFFSET;
bio->bi_max_vecs = bvec_array[idx].nr_vecs; bio->bi_max_vecs = bvec_array[idx].nr_vecs;
noiovec:
bio->bi_io_vec = bvl; bio->bi_io_vec = bvl;
bio->bi_destructor = bio_destructor; bio->bi_destructor = bio_destructor;
out: out:
......
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