All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Hugh Dickins <hugh@veritas.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH next] bio: zero inlined bio_vec
Date: Tue, 23 Dec 2008 09:07:49 +0100	[thread overview]
Message-ID: <20081223080747.GE32491@kernel.dk> (raw)
In-Reply-To: <Pine.LNX.4.64.0812230103480.19807@blonde.anvils>

On Tue, Dec 23 2008, Hugh Dickins wrote:
> bvec_alloc_bs() zeroes its bio_vec, and at least __blk_queue_bounce()
> relies upon that: therefore bio_alloc_bioset() must zero the inlined
> bio_vec - without that, lots of nastiness occurs in bounce_end_io and
> blk_rq_map_sg and other places when booting up my PAE box.
> 
> Signed-off-by: Hugh Dickins <hugh@veritas.com>
> ---
> 
>  fs/bio.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> --- linux-next/fs/bio.c	2008-12-21 20:49:25.000000000 +0000
> +++ fixed/fs/bio.c	2008-12-22 21:10:06.000000000 +0000
> @@ -324,6 +324,8 @@ struct bio *bio_alloc_bioset(gfp_t gfp_m
>  			if (nr_iovecs <= BIO_INLINE_VECS) {
>  				idx = 0;
>  				bvl = bio->bi_inline_vecs;
> +				memset(bvl, 0, BIO_INLINE_VECS *
> +							sizeof(struct bio_vec));
>  				nr_iovecs = BIO_INLINE_VECS;
>  			} else {
>  				bvl = bvec_alloc_bs(gfp_mask, nr_iovecs, &idx,

Hmm, where does it die? Nobody should look at the bio_vec index beyond
bio->bi_vcnt, and 0...bio->bi_vcnt-1 should always be initialized due to
the way we fill the entries.

-- 
Jens Axboe


  reply	other threads:[~2008-12-23  8:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-23  1:08 [PATCH next] bio: zero inlined bio_vec Hugh Dickins
2008-12-23  8:07 ` Jens Axboe [this message]
2008-12-23 10:15   ` Hugh Dickins
2008-12-23 10:23     ` Jens Axboe
2008-12-23 10:31       ` Jens Axboe
2008-12-23 11:21         ` Hugh Dickins
2008-12-23 11:39           ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081223080747.GE32491@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.