[PATCH v2] block: recalculate segment count for multi-segment discards correctly

2021-02-11 Thread David Jeffery
have multi-segment discards. It calculates the correct discard segment count by counting the number of bio as each discard bio is considered its own segment. Fixes: 1e739730c5b9 ("block: optionally merge discontiguous discard bios into a single request") Signed-off-by: David Jeffery

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 removin

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 get

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

2021-02-01 Thread David Jeffery
have multi-segment discards. It calculates the correct discard segment count by counting the number of bio as each discard bio is considered its own segment. Signed-off-by: David Jeffery Tested-by: Laurence Oberman --- block/blk-merge.c | 7 +++ 1 file changed, 7 insertions(+) diff --git

Re: [PATCH] block: Fix warning when I/O elevator is changed as request_queue is being removed

2017-08-08 Thread David Jeffery
On 08/07/2017 07:53 PM, Ming Lei wrote: > On Tue, Aug 8, 2017 at 3:38 AM, David Jeffery <djeff...@redhat.com> wrote: >> >> Signed-off-by: David Jeffery <djeff...@redhat.com> >> --- >> block/blk-sysfs.c |2 ++ >> block/elevator.c |4 >&

Re: [PATCH] block: Fix warning when I/O elevator is changed as request_queue is being removed

2017-08-08 Thread David Jeffery
On 08/07/2017 07:53 PM, Ming Lei wrote: > On Tue, Aug 8, 2017 at 3:38 AM, David Jeffery wrote: >> >> Signed-off-by: David Jeffery >> --- >> block/blk-sysfs.c |2 ++ >> block/elevator.c |4 >> 2 files changed, 6 insertions(+) >> >

[PATCH] block: Fix warning when I/O elevator is changed as request_queue is being removed

2017-08-07 Thread David Jeffery
the flag and the elevator testing the flag. Signed-off-by: David Jeffery <djeff...@redhat.com> --- block/blk-sysfs.c |2 ++ block/elevator.c |4 2 files changed, 6 insertions(+) diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 27aceab..b8362c0 100644 --- a/block/blk-sysfs.c

[PATCH] block: Fix warning when I/O elevator is changed as request_queue is being removed

2017-08-07 Thread David Jeffery
the flag and the elevator testing the flag. Signed-off-by: David Jeffery --- block/blk-sysfs.c |2 ++ block/elevator.c |4 2 files changed, 6 insertions(+) diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 27aceab..b8362c0 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c

[PATCH] Don't leak a key reference if request_key() tries to use a revoked keyring

2015-02-11 Thread David Jeffery
after the attempt to insert into the requested keyring is rejected. key_put() needs to be called in the link_prealloc_failed callpath to ensure the unused key is released. Signed-off-by: David Jeffery --- The basic way to trigger this is to use keyctl to revoke a session's keyring, then do

[PATCH] Don't leak a key reference if request_key() tries to use a revoked keyring

2015-02-11 Thread David Jeffery
after the attempt to insert into the requested keyring is rejected. key_put() needs to be called in the link_prealloc_failed callpath to ensure the unused key is released. Signed-off-by: David Jeffery djeff...@redhat.com --- The basic way to trigger this is to use keyctl to revoke a session's

Re: [PATCH] Return short read or 0 at end of a raw device, not EIO

2014-09-30 Thread David Jeffery
On 09/30/2014 11:28 AM, Christoph Hellwig wrote: > On Mon, Sep 29, 2014 at 06:08:11PM -0400, David Jeffery wrote: >> On 09/29/2014 03:05 PM, Christoph Hellwig wrote: >>> Seems like this should be changed in the generic code, or is there some >>> reason why it would

Re: [PATCH] Return short read or 0 at end of a raw device, not EIO

2014-09-30 Thread David Jeffery
On 09/30/2014 11:28 AM, Christoph Hellwig wrote: On Mon, Sep 29, 2014 at 06:08:11PM -0400, David Jeffery wrote: On 09/29/2014 03:05 PM, Christoph Hellwig wrote: Seems like this should be changed in the generic code, or is there some reason why it would return EIO only for devices

Re: [PATCH] Return short read or 0 at end of a raw device, not EIO

2014-09-29 Thread David Jeffery
ts. The file systems manage direct I/O EOF handling in their own block or direct_IO callbacks. Block devices do not and instead do the size checks up front. Raw devices were bypassing the block device check, so only the raw driver should be having this issue. David Jeffery -- To unsubscribe from thi

[PATCH] Return short read or 0 at end of a raw device, not EIO

2014-09-29 Thread David Jeffery
of device handling as was added for normal block devices. Using blkdev_read_iter, which has the needed size checks, prevents the EIO conditions at the end of the device. Signed-off-by: David Jeffery --- drivers/char/raw.c |2 +- fs/block_dev.c |3 ++- include/linux/fs.h |1 + 3

[PATCH] Return short read or 0 at end of a raw device, not EIO

2014-09-29 Thread David Jeffery
of device handling as was added for normal block devices. Using blkdev_read_iter, which has the needed size checks, prevents the EIO conditions at the end of the device. Signed-off-by: David Jeffery djeff...@redhat.com --- drivers/char/raw.c |2 +- fs/block_dev.c |3 ++- include/linux

Re: [PATCH] Return short read or 0 at end of a raw device, not EIO

2014-09-29 Thread David Jeffery
manage direct I/O EOF handling in their own block or direct_IO callbacks. Block devices do not and instead do the size checks up front. Raw devices were bypassing the block device check, so only the raw driver should be having this issue. David Jeffery -- To unsubscribe from this list: send