Re: [PATCH] block: recalculate segment count for multi-segment discard requests correctly

2021-02-08 Thread John Pittman
Hi Jens, when you get a moment, could you take a quick look at this one for ack? On Thu, Feb 4, 2021 at 11:49 AM Laurence Oberman wrote: > > On Thu, 2021-02-04 at 10:27 +0800, Ming Lei wrote: > > On Mon, Feb 01, 2021 at 11:48:50AM -0500, David Jeffery wrote: > > > When a stacked block device inse

Re: [PATCH] block: recalculate segment count for multi-segment discard requests correctly

2021-02-08 Thread Laurence Oberman
On Thu, 2021-02-04 at 11:43 -0500, Laurence Oberman wrote: > On Thu, 2021-02-04 at 10:27 +0800, Ming Lei wrote: > > On Mon, Feb 01, 2021 at 11:48:50AM -0500, David Jeffery wrote: > > > When a stacked block device inserts a request into another block > > > device > > > using blk_insert_cloned_reques

Re: [PATCH] block: recalculate segment count for multi-segment discard requests correctly

2021-02-04 Thread Laurence Oberman
On Thu, 2021-02-04 at 10:27 +0800, Ming Lei wrote: > On Mon, Feb 01, 2021 at 11:48:50AM -0500, David Jeffery wrote: > > When a stacked block device inserts a request into another block > > device > > using blk_insert_cloned_request, the request's nr_phys_segments > > field gets > > recalculated by

Re: [PATCH] block: recalculate segment count for multi-segment discard requests correctly

2021-02-03 Thread Ming Lei
On Mon, Feb 01, 2021 at 11:48:50AM -0500, David Jeffery wrote: > When a stacked block device inserts a request into another block device > using blk_insert_cloned_request, the request's nr_phys_segments field gets > recalculated by a call to blk_recalc_rq_segments in > blk_cloned_rq_check_limits. B

Re: [PATCH] block: recalculate segment count for multi-segment discard requests correctly

2021-02-03 Thread Ming Lei
On Wed, Feb 03, 2021 at 11:23:37AM -0500, David Jeffery wrote: > On Wed, Feb 03, 2021 at 10:35:17AM +0800, Ming Lei wrote: > > > > On Tue, Feb 02, 2021 at 03:43:55PM -0500, David Jeffery wrote: > > > The return 0 does seem to be an old relic that does not make sense > > > anymore. > > > Moving RE

Re: [PATCH] block: recalculate segment count for multi-segment discard requests correctly

2021-02-03 Thread David Jeffery
On Wed, Feb 03, 2021 at 10:35:17AM +0800, Ming Lei wrote: > > On Tue, Feb 02, 2021 at 03:43:55PM -0500, David Jeffery wrote: > > The return 0 does seem to be an old relic that does not make sense anymore. > > Moving REQ_OP_SECURE_ERASE to be with discard and removing the old return 0, > > is this

Re: [PATCH] block: recalculate segment count for multi-segment discard requests correctly

2021-02-03 Thread Laurence Oberman
On Wed, 2021-02-03 at 08:50 -0500, Laurence Oberman wrote: > On Wed, 2021-02-03 at 03:15 +, Chaitanya Kulkarni wrote: > > On 2/2/21 18:39, Ming Lei wrote: > > > + /* fall through */ > > > case REQ_OP_WRITE_ZEROES: > > > - return 0; > > > > I don't think returning 1 for write-

Re: [PATCH] block: recalculate segment count for multi-segment discard requests correctly

2021-02-03 Thread Laurence Oberman
On Wed, 2021-02-03 at 03:15 +, Chaitanya Kulkarni wrote: > On 2/2/21 18:39, Ming Lei wrote: > > + /* fall through */ > > case REQ_OP_WRITE_ZEROES: > > - return 0; > > I don't think returning 1 for write-zeroes is right, > did you test this patch with write-zeores enable

Re: [PATCH] block: recalculate segment count for multi-segment discard requests correctly

2021-02-02 Thread Chaitanya Kulkarni
On 2/2/21 18:39, Ming Lei wrote: > + struct bio *bio = rq->bio; > + for_each_bio(bio) > + nr_phys_segs++; > + return nr_phys_segs; > + } Also, you need to add a new line after declaration of bio in t

Re: [PATCH] block: recalculate segment count for multi-segment discard requests correctly

2021-02-02 Thread Chaitanya Kulkarni
On 2/2/21 18:39, Ming Lei wrote: > + /* fall through */ > case REQ_OP_WRITE_ZEROES: > - return 0; I don't think returning 1 for write-zeroes is right, did you test this patch with write-zeores enabled controller with the right fs that triggers this behavior ?

Re: [PATCH] block: recalculate segment count for multi-segment discard requests correctly

2021-02-02 Thread Ming Lei
On Tue, Feb 02, 2021 at 03:43:55PM -0500, David Jeffery wrote: > On Tue, Feb 02, 2021 at 11:33:43AM +0800, Ming Lei wrote: > > > > On Mon, Feb 01, 2021 at 11:48:50AM -0500, David Jeffery wrote: > > > When a stacked block device inserts a request into another block device > > > using blk_insert_clo

Re: [PATCH] block: recalculate segment count for multi-segment discard requests correctly

2021-02-02 Thread David Jeffery
On Tue, Feb 02, 2021 at 11:33:43AM +0800, Ming Lei wrote: > > On Mon, Feb 01, 2021 at 11:48:50AM -0500, David Jeffery wrote: > > When a stacked block device inserts a request into another block device > > using blk_insert_cloned_request, the request's nr_phys_segments field gets > > recalculated b

Re: [PATCH] block: recalculate segment count for multi-segment discard requests correctly

2021-02-01 Thread Ming Lei
On Mon, Feb 01, 2021 at 11:48:50AM -0500, David Jeffery wrote: > When a stacked block device inserts a request into another block device > using blk_insert_cloned_request, the request's nr_phys_segments field gets > recalculated by a call to blk_recalc_rq_segments in > blk_cloned_rq_check_limits. B

[PATCH] block: recalculate segment count for multi-segment discard requests correctly

2021-02-01 Thread David Jeffery
When a stacked block device inserts a request into another block device using blk_insert_cloned_request, the request's nr_phys_segments field gets recalculated by a call to blk_recalc_rq_segments in blk_cloned_rq_check_limits. But blk_recalc_rq_segments does not know how to handle multi-segment dis