2006-05-22 06:19:38

by NeilBrown

[permalink] [raw]
Subject: [PATCH 002 of 2] md: Make sure bi_max_vecs is set properly in bio_split


Else a subsequence bio_clone might make a mess.

Signed-off-by: Neil Brown <[email protected]>
Cc: "Don Dupuis" <[email protected]>
Cc: Jens Axboe <[email protected]>
### Diffstat output
./fs/bio.c | 3 +++
1 file changed, 3 insertions(+)

diff ./fs/bio.c~current~ ./fs/bio.c
--- ./fs/bio.c~current~ 2006-05-22 16:12:46.000000000 +1000
+++ ./fs/bio.c 2006-05-22 16:12:16.000000000 +1000
@@ -1103,6 +1103,9 @@ struct bio_pair *bio_split(struct bio *b
bp->bio1.bi_io_vec = &bp->bv1;
bp->bio2.bi_io_vec = &bp->bv2;

+ bp->bio1.bi_max_vecs = 1;
+ bp->bio2.bi_max_vecs = 1;
+
bp->bio1.bi_end_io = bio_pair_end_1;
bp->bio2.bi_end_io = bio_pair_end_2;


2006-05-22 07:01:36

by Jens Axboe

[permalink] [raw]
Subject: Re: [PATCH 002 of 2] md: Make sure bi_max_vecs is set properly in bio_split

On Mon, May 22 2006, NeilBrown wrote:
>
> Else a subsequence bio_clone might make a mess.
>
> Signed-off-by: Neil Brown <[email protected]>
> Cc: "Don Dupuis" <[email protected]>
> Cc: Jens Axboe <[email protected]>
> ### Diffstat output
> ./fs/bio.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff ./fs/bio.c~current~ ./fs/bio.c
> --- ./fs/bio.c~current~ 2006-05-22 16:12:46.000000000 +1000
> +++ ./fs/bio.c 2006-05-22 16:12:16.000000000 +1000
> @@ -1103,6 +1103,9 @@ struct bio_pair *bio_split(struct bio *b
> bp->bio1.bi_io_vec = &bp->bv1;
> bp->bio2.bi_io_vec = &bp->bv2;
>
> + bp->bio1.bi_max_vecs = 1;
> + bp->bio2.bi_max_vecs = 1;
> +
> bp->bio1.bi_end_io = bio_pair_end_1;
> bp->bio2.bi_end_io = bio_pair_end_2;
>

Obviously correct, thanks Neil.

--
Jens Axboe