All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] blk-merge: fix computing bio->bi_seg_front_size in case of single segment
@ 2015-11-30  8:05 Ming Lei
  2015-11-30 20:01 ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Ming Lei @ 2015-11-30  8:05 UTC (permalink / raw)
  To: Jens Axboe, linux-kernel
  Cc: linux-block, Christoph Hellwig, Hannes Reinecke,
	Markus Trippelsdorf, Ming Lei

When bio has only one physical segment, we should set bio's
bi_seg_front_size as the real(final) size of the single segment.

Fixes: 02e707424c2ea(blk-merge: fix blk_bio_segment_split)
Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Tested-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
 block/blk-merge.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/block/blk-merge.c b/block/blk-merge.c
index 41a55ba..e01405a 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -103,6 +103,9 @@ static struct bio *blk_bio_segment_split(struct request_queue *q,
 			bvprv = bv;
 			bvprvp = &bvprv;
 			sectors += bv.bv_len >> 9;
+
+			if (nsegs == 1 && seg_size > front_seg_size)
+				front_seg_size = seg_size;
 			continue;
 		}
 new_segment:
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] blk-merge: fix computing bio->bi_seg_front_size in case of single segment
  2015-11-30  8:05 [PATCH] blk-merge: fix computing bio->bi_seg_front_size in case of single segment Ming Lei
@ 2015-11-30 20:01 ` Jens Axboe
  2015-11-30 20:03   ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Jens Axboe @ 2015-11-30 20:01 UTC (permalink / raw)
  To: Ming Lei, linux-kernel
  Cc: linux-block, Christoph Hellwig, Hannes Reinecke, Markus Trippelsdorf

On 11/30/2015 01:05 AM, Ming Lei wrote:
> When bio has only one physical segment, we should set bio's
> bi_seg_front_size as the real(final) size of the single segment.
>
> Fixes: 02e707424c2ea(blk-merge: fix blk_bio_segment_split)
> Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de>
> Tested-by: Markus Trippelsdorf <markus@trippelsdorf.de>
> Signed-off-by: Ming Lei <ming.lei@canonical.com>

I'm going to fold this into the offending patch. Thanks Ming!

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] blk-merge: fix computing bio->bi_seg_front_size in case of single segment
  2015-11-30 20:01 ` Jens Axboe
@ 2015-11-30 20:03   ` Jens Axboe
  0 siblings, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2015-11-30 20:03 UTC (permalink / raw)
  To: Ming Lei, linux-kernel
  Cc: linux-block, Christoph Hellwig, Hannes Reinecke, Markus Trippelsdorf

On 11/30/2015 01:01 PM, Jens Axboe wrote:
> On 11/30/2015 01:05 AM, Ming Lei wrote:
>> When bio has only one physical segment, we should set bio's
>> bi_seg_front_size as the real(final) size of the single segment.
>>
>> Fixes: 02e707424c2ea(blk-merge: fix blk_bio_segment_split)
>> Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de>
>> Tested-by: Markus Trippelsdorf <markus@trippelsdorf.de>
>> Signed-off-by: Ming Lei <ming.lei@canonical.com>
>
> I'm going to fold this into the offending patch. Thanks Ming!

Applied separately, I mixed up two different patches. Applied for 4.4.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-30 20:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-30  8:05 [PATCH] blk-merge: fix computing bio->bi_seg_front_size in case of single segment Ming Lei
2015-11-30 20:01 ` Jens Axboe
2015-11-30 20:03   ` Jens Axboe

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.