linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Johannes Thumshirn <jthumshirn@suse.de>
Cc: Hannes Reinecke <hare@suse.de>,
	Bart Van Assche <bvanassche@acm.org>,
	Christoph Hellwig <hch@lst.de>, Jan Kara <jack@suse.cz>,
	Linux Block Layer Mailinglist <linux-block@vger.kernel.org>,
	Linux FSDEVEL Mailinglist <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH v2 1/3] block: bio: kill BIO_SEG_VALID flag
Date: Sat, 23 Mar 2019 13:31:43 -0600	[thread overview]
Message-ID: <1b279b39-310c-b180-a880-79a3f65df48e@kernel.dk> (raw)
In-Reply-To: <8273b995-01c2-fbf4-b8be-484508c65938@kernel.dk>

On 3/22/19 4:00 PM, Jens Axboe wrote:
> On 3/22/19 7:13 AM, Johannes Thumshirn wrote:
>> @@ -712,7 +714,10 @@ int bio_add_pc_page(struct request_queue *q, struct bio *bio, struct page
>>  	bvec->bv_len = len;
>>  	bvec->bv_offset = offset;
>>  	bio->bi_vcnt++;
>> -	bio->bi_phys_segments++;
>> +	if (bio->bi_phys_segments == -1)
>> +		bio->bi_phys_segments = 1;
>> +	else
>> +		bio->bi_phys_segments++;
>>  	bio->bi_iter.bi_size += len;
> 
> Echo Christophs suggestion here.
> 
>> diff --git a/block/blk-core.c b/block/blk-core.c
>> index 4673ebe42255..53372a16dd7c 100644
>> --- a/block/blk-core.c
>> +++ b/block/blk-core.c
>> @@ -1514,6 +1514,7 @@ void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
>>  	else if (bio_op(bio) == REQ_OP_DISCARD)
>>  		rq->nr_phys_segments = 1;
>>  
>> +	WARN_ON(rq->nr_phys_segments == -1);
>>  	rq->__data_len = bio->bi_iter.bi_size;
>>  	rq->bio = rq->biotail = bio;
> 
> Just make that:
> 
> 	else
> 		rq->nr_phys_segments = 0;
> 
> for the third case?

Would be great if you could spin a v3 with the mentioned changes, against
master since the BIO_NO_PAGE_REF change is now merged there.

-- 
Jens Axboe


  reply	other threads:[~2019-03-23 19:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-22 13:13 [PATCH v2 0/3] add flag for tracking bio allocation Johannes Thumshirn
2019-03-22 13:13 ` [PATCH v2 1/3] block: bio: kill BIO_SEG_VALID flag Johannes Thumshirn
2019-03-22 14:01   ` Christoph Hellwig
2019-03-25  8:02     ` Johannes Thumshirn
2019-03-22 14:06   ` Hannes Reinecke
2019-03-22 22:00   ` Jens Axboe
2019-03-23 19:31     ` Jens Axboe [this message]
2019-03-25 13:32       ` Johannes Thumshirn
2019-03-22 22:40   ` Ming Lei
2019-03-22 13:13 ` [PATCH v2 2/3] block: bio: ensure newly added bio flags don't override BVEC_POOL_IDX Johannes Thumshirn
2019-03-22 14:01   ` Christoph Hellwig
2019-03-22 14:07   ` Hannes Reinecke
2019-03-22 13:13 ` [PATCH v2 3/3] block: bio: introduce BIO_ALLOCED flag and check it in bio_free Johannes Thumshirn
2019-03-22 14:02   ` Christoph Hellwig
2019-03-22 14:05     ` Hannes Reinecke
2019-03-22 21:30       ` Keith Busch
2019-03-22 23:04         ` Ming Lei
2019-03-22 14:10   ` Hannes Reinecke

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=1b279b39-310c-b180-a880-79a3f65df48e@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=jthumshirn@suse.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).