Messages in this thread | | | Date | Mon, 11 Aug 2014 16:13:54 +0200 | From | Maurizio Lombardi <> | Subject | Re: [PATCH] bio: merge_bvec_fn() must be called with the old bi_iter.bi_size value |
| |
Hi Jens,
On 07/17/2014 10:49 AM, Maurizio Lombardi wrote: > The patch "bio: modify __bio_add_page() to accept pages that > don't start a new segment" updates bio->bi_iter.bi_size before > calling merge_bvec_fn(). > > This panics the kernel because merge_bvec_fn() expects bi_size to have > the old value. > > This can be reproduced by trying to create a crypto device with cryptsetup.
Can we give to this patch "bio: modify __bio_add_page() to accept pages that don't start a new segment" another chance to get in?
Should I squash it with the following fix and resubmit as a single patch or it's not necessary?
> > Reported-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu> > Signed-off-by: Maurizio Lombardi <mlombard@redhat.com> > --- > block/bio.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/block/bio.c b/block/bio.c > index fb12df9..40c5b12 100644 > --- a/block/bio.c > +++ b/block/bio.c > @@ -795,7 +795,7 @@ static int __bio_add_page(struct request_queue *q, struct bio *bio, struct page > struct bvec_merge_data bvm = { > .bi_bdev = bio->bi_bdev, > .bi_sector = bio->bi_iter.bi_sector, > - .bi_size = bio->bi_iter.bi_size, > + .bi_size = bio->bi_iter.bi_size - len, > .bi_rw = bio->bi_rw, > }; > >
Thanks, Maurizio Lombardi
| |