]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Fix for raid1 against 2.5.43
authorAngus Sawyer <angus.sawyer@dsl.pipex.com>
Fri, 18 Oct 2002 08:38:34 +0000 (01:38 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Fri, 18 Oct 2002 08:38:34 +0000 (01:38 -0700)
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.

fs/bio.c

index 6c196406c90a19ef7181c749504b036efee673bb..544b6e8913439101455f5c260b9c48628b67d520 100644 (file)
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -149,12 +149,13 @@ struct bio *bio_alloc(int gfp_mask, int nr_iovecs)
        bio_init(bio);
 
        if (unlikely(!nr_iovecs))
-               goto out;
+               goto noiovec;
 
        bvl = bvec_alloc(gfp_mask, nr_iovecs, &idx);
        if (bvl) {
                bio->bi_flags |= idx << BIO_POOL_OFFSET;
                bio->bi_max_vecs = bvec_array[idx].nr_vecs;
+noiovec:
                bio->bi_io_vec = bvl;
                bio->bi_destructor = bio_destructor;
 out: