Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1372099

Re: [PATCH 11/27] bcache: io.c: use bio_set_vec_table

From Kent Overstreet <kent.overstreet@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 11/27] bcache: io.c: use bio_set_vec_table
Date 2016-04-06 02:40 +0200
Message-ID <rkJFM-3PD-19@gated-at.bofh.it> (permalink)
References <rkxOi-2K6-15@gated-at.bofh.it> <rkxXY-36a-27@gated-at.bofh.it> <rkyAH-3wP-29@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Apr 05, 2016 at 05:49:02AM -0700, Christoph Hellwig wrote:
> On Tue, Apr 05, 2016 at 07:56:56PM +0800, Ming Lei wrote:
> > diff --git a/drivers/md/bcache/io.c b/drivers/md/bcache/io.c
> > index 86a0bb8..1c48462 100644
> > --- a/drivers/md/bcache/io.c
> > +++ b/drivers/md/bcache/io.c
> > @@ -26,8 +26,7 @@ struct bio *bch_bbio_alloc(struct cache_set *c)
> >  
> >  	bio_init(bio);
> >  	bio->bi_flags		|= BIO_POOL_NONE << BIO_POOL_OFFSET;
> > -	bio->bi_max_vecs	 = bucket_pages(c);
> > -	bio->bi_io_vec		 = bio->bi_inline_vecs;
> > +	bio_set_vec_table(bio, bio->bi_inline_vecs, bucket_pages(c));
> 
> All this bcache code needs to move away from bio_init on a bio
> embedded in a driver private structure toward properly using
> bio_alloc / bio_alloc_bioset.  That will also fix the crash
> with bcache over md that Shaohua reported, so I'd suggest to fast
> track this part of the series.

Why?

bio_init() is a publicly exported function, it's always been one and bcache is
ot the only driver to use it directly.

bios with > BIO_MAX_PAGES bvecs is a separate issue; I would argue that the bug
is in md's queue_limits; it uses blk_set_stacking_limits() which sets
max_segments = USHRT_MAX, which is wrong if it's going to clone the biovec.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/27] block: cleanup direct access on .bi_vcnt & .bi_io_vec Ming Lei <tom.leiming@gmail.com> - 2016-04-05 14:00 +0200
  [PATCH 02/27] block: drbd: use bio_get_base_vec() to retrieve the 1st bvec Ming Lei <tom.leiming@gmail.com> - 2016-04-05 14:00 +0200
  [PATCH 05/27] block: pktcdvd: use bio_get_base_vec() to retrive bvec table Ming Lei <tom.leiming@gmail.com> - 2016-04-05 14:00 +0200
  [PATCH 04/27] block: loop: use bio_get_base_vec() to retrive bvec table Ming Lei <tom.leiming@gmail.com> - 2016-04-05 14:00 +0200
  [PATCH 03/27] block: drbd: remove impossible failure handling Ming Lei <tom.leiming@gmail.com> - 2016-04-05 14:00 +0200
    Re: [PATCH 03/27] block: drbd: remove impossible failure handling Lars Ellenberg <lars.ellenberg@linbit.com> - 2016-04-05 14:50 +0200
  [PATCH 11/27] bcache: io.c: use bio_set_vec_table Ming Lei <tom.leiming@gmail.com> - 2016-04-05 14:10 +0200
    Re: [PATCH 11/27] bcache: io.c: use bio_set_vec_table Christoph Hellwig <hch@infradead.org> - 2016-04-05 14:50 +0200
      Re: [PATCH 11/27] bcache: io.c: use bio_set_vec_table Ming Lei <tom.leiming@gmail.com> - 2016-04-05 17:30 +0200
        Re: [PATCH 11/27] bcache: io.c: use bio_set_vec_table Christoph Hellwig <hch@infradead.org> - 2016-04-05 19:40 +0200
      Re: [PATCH 11/27] bcache: io.c: use bio_set_vec_table Kent Overstreet <kent.overstreet@gmail.com> - 2016-04-06 02:40 +0200
  [PATCH 12/27] bcache: journal.c: use bio_set_vec_table() Ming Lei <tom.leiming@gmail.com> - 2016-04-05 14:10 +0200
  [PATCH 08/27] staging: lustre: avoid to use bio->bi_vcnt directly Ming Lei <tom.leiming@gmail.com> - 2016-04-05 14:10 +0200
    Re: [PATCH 08/27] staging: lustre: avoid to use bio->bi_vcnt directly Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-05 15:00 +0200
    Re: [PATCH 08/27] staging: lustre: avoid to use bio->bi_vcnt directly Christoph Hellwig <hch@infradead.org> - 2016-04-05 15:10 +0200
      Re: [PATCH 08/27] staging: lustre: avoid to use bio->bi_vcnt  directly James Simmons <jsimmons@infradead.org> - 2016-04-10 16:40 +0200
        Re: [PATCH 08/27] staging: lustre: avoid to use bio->bi_vcnt directly Christoph Hellwig <hch@infradead.org> - 2016-04-10 16:50 +0200
          Re: [PATCH 08/27] staging: lustre: avoid to use bio->bi_vcnt  directly James Simmons <jsimmons@infradead.org> - 2016-04-10 18:10 +0200
            Re: [PATCH 08/27] staging: lustre: avoid to use bio->bi_vcnt directly Ming Lei <tom.leiming@gmail.com> - 2016-04-11 05:40 +0200
  [PATCH 10/27] bcache: debug: avoid to access .bi_io_vec directly Ming Lei <tom.leiming@gmail.com> - 2016-04-05 14:10 +0200
  [PATCH 07/27] block: floppy: use bio_add_page() Ming Lei <tom.leiming@gmail.com> - 2016-04-05 14:10 +0200
  [PATCH 09/27] target: use bio_is_full() Ming Lei <tom.leiming@gmail.com> - 2016-04-05 14:10 +0200
    Re: [PATCH 09/27] target: use bio_is_full() Christoph Hellwig <hch@infradead.org> - 2016-04-05 15:10 +0200
      Re: [PATCH 09/27] target: use bio_is_full() Ming Lei <tom.leiming@gmail.com> - 2016-04-07 06:10 +0200
  [PATCH 14/27] bcache: writeback: use bio_set_vec_table() Ming Lei <tom.leiming@gmail.com> - 2016-04-05 14:10 +0200
  [PATCH 13/27] bcache: movinggc: use bio_set_vec_table() Ming Lei <tom.leiming@gmail.com> - 2016-04-05 14:10 +0200
  [PATCH 06/27] block: floppy: use bio_set_vec_table() Ming Lei <tom.leiming@gmail.com> - 2016-04-05 14:20 +0200
    Re: [PATCH 06/27] block: floppy: use bio_set_vec_table() Christoph Hellwig <hch@infradead.org> - 2016-04-05 15:10 +0200

csiph-web