[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <53E8CFA2.60408@redhat.com>
Date: Mon, 11 Aug 2014 16:13:54 +0200
From: Maurizio Lombardi <mlombard@...hat.com>
To: axboe@...nel.dk
CC: linux-kernel@...r.kernel.org, ming.lei@...onical.com,
jet.chen@...el.com, akpm@...ux-foundation.org,
Valdis.Kletnieks@...edu
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@...edu>
> Signed-off-by: Maurizio Lombardi <mlombard@...hat.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists