Re: [dm-devel] [PATCH v6 00/18] Use block pr_ops in LIO

2023-04-13 Thread Mike Christie
On 4/12/23 5:25 AM, Naresh Kamboju wrote: > On Wed, 12 Apr 2023 at 15:06, Naresh Kamboju > wrote: >> >> [sorry for the adding you in CC] >> >> While running LTP controllers test suite on this patch set applied on top of >> the next-20230406 and the following kernel panic noticed on qemu-i386. >

[dm-devel] [PATCH v6 03/18] scsi: Rename sd_pr_command

2023-04-11 Thread Mike Christie
Rename sd_pr_command to sd_pr_out_command to match a sd_pr_in_command helper added in the next patches. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Bart Van Assche --- drivers/scsi/sd.c | 12 ++-- 1 file changed, 6

[dm-devel] [PATCH v6 04/18] scsi: Move sd_pr_type to scsi_common

2023-04-11 Thread Mike Christie
LIO is going to want to do the same block to/from SCSI pr types as sd.c so this moves the sd_pr_type helper to scsi_common and renames it. The next patch will then also add a helper to go from the SCSI value to the block one for use with PERSISTENT_RESERVE_IN commands. Signed-off-by: Mike

[dm-devel] [PATCH v6 13/18] nvme: Add pr_ops read_reservation support

2023-04-11 Thread Mike Christie
This patch adds support for the pr_ops read_reservation callout by calling the NVMe Reservation Report helper. It then parses that info to detect if there is a reservation and if there is then convert the returned info to a pr_ops pr_held_reservation struct. Signed-off-by: Mike Christie Reviewed

[dm-devel] [PATCH v6 02/18] block: Rename BLK_STS_NEXUS to BLK_STS_RESV_CONFLICT

2023-04-11 Thread Mike Christie
. Signed-off-by: Mike Christie Acked-by: Stefan Haberland Reviewed-by: Bart Van Assche --- block/blk-core.c | 2 +- drivers/nvme/host/core.c | 2 +- drivers/s390/block/dasd.c | 7 ++- drivers/scsi/scsi_lib.c | 2 +- include/linux/blk_types.h | 4 ++-- 5 files changed, 11 insertions

[dm-devel] [PATCH v6 01/18] block: Add PR callouts for read keys and reservation

2023-04-11 Thread Mike Christie
Add callouts for reading keys and reservations. This allows LIO to support the READ_KEYS and READ_RESERVATION commands so it can export devices to VMs for software like windows clustering. Signed-off-by: Mike Christie Reviewed-by: Chaitanya Kulkarni Reviewed-by: Christoph Hellwig Reviewed

[dm-devel] [PATCH v6 16/18] scsi: target: Pass struct target_opcode_descriptor to enabled

2023-04-11 Thread Mike Christie
if the command is supported based on the command and service action and device settings. Signed-off-by: Mike Christie --- drivers/target/target_core_spc.c | 40 +++ include/target/target_core_base.h | 3 ++- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git

[dm-devel] [PATCH v6 10/18] nvme: Add helper to send pr command

2023-04-11 Thread Mike Christie
Move the code that checks for multipath support and sends the pr command to a new helper so it can be used by the reservation report support added in the next patches. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig --- drivers/nvme/host/pr.c | 23 ++- 1 file

[dm-devel] [PATCH v6 15/18] scsi: target: Allow backends to hook into PR handling

2023-04-11 Thread Mike Christie
I_T nexus. This patch adds the initial LIO callouts. The next patch will modify iblock. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig --- drivers/target/target_core_pr.c | 62 +++- include/target/target_core_backend.h | 4 ++ 2 files changed, 65

[dm-devel] [PATCH v6 08/18] nvme: Don't hardcode the data len for pr commands

2023-04-11 Thread Mike Christie
Reservation Report support needs to pass in a variable sized buffer, so this patch has the pr command helpers take a data length argument. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Chaitanya Kulkarni --- drivers/nvme/host/core.c | 13

[dm-devel] [PATCH v6 07/18] nvme: Fix reservation status related structs

2023-04-11 Thread Mike Christie
-by: Mike Christie --- include/linux/nvme.h | 38 ++ 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/include/linux/nvme.h b/include/linux/nvme.h index 779507ac750b..83704fc04a94 100644 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h @@ -759,20

[dm-devel] [PATCH v6 17/18] scsi: target: Report and detect unsupported PR commands

2023-04-11 Thread Mike Christie
The backend modules don't know about ports and I_T nexuses and the pr_ops callouts the modules will use don't support the old RESERVE/RELEASE commands. This patch has us report we don't support those types of commands and fail them. Signed-off-by: Mike Christie --- drivers/target

[dm-devel] [PATCH v6 18/18] scsi: target: Add block PR support to iblock

2023-04-11 Thread Mike Christie
This adds support for the block PR callouts to target_core_iblock. This patch doesn't attempt to implement the entire spec because there's no way support it all like SPEC_I_PT and ALL_TG_PT. This only supports exporting the iblock device from one path on the local target. Signed-off-by: Mike

[dm-devel] [PATCH v6 00/18] Use block pr_ops in LIO

2023-04-11 Thread Mike Christie
The patches in this thread allow us to use the block pr_ops with LIO's target_core_iblock module to support cluster applications in VMs. They were built over Linus's tree. They also apply over linux-next and Martin's tree and Jens's trees. Currently, to use windows clustering or linux clustering

[dm-devel] [PATCH v6 05/18] scsi: Add support for block PR read keys/reservation

2023-04-11 Thread Mike Christie
This adds support in sd.c for the block PR read keys and read reservation callouts, so upper layers like LIO can get the PR info that's been setup using the existing pr callouts and return it to initiators. Signed-off-by: Mike Christie Reviewed-by: Chaitanya Kulkarni Reviewed-by: Christoph

[dm-devel] [PATCH v6 11/18] nvme: Add pr_ops read_keys support

2023-04-11 Thread Mike Christie
just returns the registered keys which is required by the SCSI PR in READ KEYS command. Signed-off-by: Mike Christie --- drivers/nvme/host/pr.c | 69 ++ include/linux/nvme.h | 4 +++ 2 files changed, 73 insertions(+) diff --git a/drivers/nvme/host/pr.c b

[dm-devel] [PATCH v6 12/18] nvme: Add a nvme_pr_type enum

2023-04-11 Thread Mike Christie
function. Signed-off-by: Mike Christie Reviewed-by: Chaitanya Kulkarni Reviewed-by: Christoph Hellwig --- drivers/nvme/host/pr.c | 24 include/linux/nvme.h | 9 + 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/drivers/nvme/host/pr.c b/drivers

[dm-devel] [PATCH v6 09/18] nvme: Move pr code to it's own file

2023-04-11 Thread Mike Christie
This patch moves the pr code to it's own file because I'm going to be adding more functions and core.c is getting bigger. Signed-off-by: Mike Christie Reviewed-by: Chaitanya Kulkarni Reviewed-by: Keith Busch --- drivers/nvme/host/Makefile | 2 +- drivers/nvme/host/core.c | 148

[dm-devel] [PATCH v6 06/18] dm: Add support for block PR read keys/reservation

2023-04-11 Thread Mike Christie
This adds support in dm for the block PR read keys and read reservation callouts. Signed-off-by: Mike Christie --- drivers/md/dm.c | 69 + 1 file changed, 69 insertions(+) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index dfde0088147a

[dm-devel] [PATCH v6 14/18] scsi: target: Rename sbc_ops to exec_cmd_ops

2023-04-11 Thread Mike Christie
The next patches allow us to call the block layer's pr_ops from the backends. This will require allowing the backends to hook into the cmd processing for SPC commands, so this renames sbc_ops to a more generic exec_cmd_ops. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig

Re: [dm-devel] [PATCH v5 11/18] nvme: Add pr_ops read_keys support

2023-03-29 Thread Mike Christie
328] > [If your patch is applied to the wrong git tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch#_base_tree_information] > > url: > https://github.com/intel-lab-lkp/linux/commits/Mike-

Re: [dm-devel] [PATCH v5 01/18] block: Add PR callouts for read keys and reservation

2023-03-29 Thread Mike Christie
On 3/28/23 11:36 AM, Mike Snitzer wrote: > On Fri, Mar 24 2023 at 2:17P -0400, > Mike Christie wrote: > >> Add callouts for reading keys and reservations. This allows LIO to support >> the READ_KEYS and READ_RESERVATION commands and will allow dm-multipath >> to opti

[dm-devel] [PATCH v5 00/18] Use block pr_ops in LIO

2023-03-26 Thread Mike Christie
The patches in this thread allow us to use the block pr_ops with LIO's target_core_iblock module to support cluster applications in VMs. They were built over Linus's tree. They also apply over linux-next and Martin's tree and Jens's trees. Currently, to use windows clustering or linux

[dm-devel] [PATCH v5 18/18] scsi: target: Add block PR support to iblock

2023-03-26 Thread Mike Christie
This adds support for the block PR callouts to target_core_iblock. This patch doesn't attempt to implement the entire spec because there's no way support it all like SPEC_I_PT and ALL_TG_PT. This only supports exporting the iblock device from one path on the local target. Signed-off-by: Mike

[dm-devel] [PATCH v5 16/18] scsi: target: Pass struct target_opcode_descriptor to enabled

2023-03-26 Thread Mike Christie
if the command is supported based on the command and service action and device settings. Signed-off-by: Mike Christie --- drivers/target/target_core_spc.c | 40 +++ include/target/target_core_base.h | 3 ++- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git

[dm-devel] [PATCH v5 01/18] block: Add PR callouts for read keys and reservation

2023-03-26 Thread Mike Christie
and NVMe's report reservation commands. Those are overkill for dm/LIO and READ_FULL_STATUS is sometimes broken for SCSI devices. Signed-off-by: Mike Christie Reviewed-by: Chaitanya Kulkarni Reviewed-by: Christoph Hellwig --- include/linux/pr.h | 25 + 1 file changed, 25

[dm-devel] [PATCH v5 04/18] scsi: Move sd_pr_type to header to share

2023-03-26 Thread Mike Christie
LIO is going to want to do the same block to/from SCSI pr types as sd.c so this moves the sd_pr_type helper to a new file. The next patch will then also add a helper to go from the SCSI value to the block one for use with PERSISTENT_RESERVE_IN commands. Signed-off-by: Mike Christie Reviewed

[dm-devel] [PATCH v5 17/18] scsi: target: Report and detect unsupported PR commands

2023-03-26 Thread Mike Christie
The backend modules don't know about ports and I_T nexuses and the pr_ops callouts the modules will use don't support the old RESERVE/RELEASE commands. This patch has us report we don't support those types of commands and fail them. Signed-off-by: Mike Christie --- drivers/target

[dm-devel] [PATCH v5 15/18] scsi: target: Allow backends to hook into PR handling

2023-03-26 Thread Mike Christie
I_T nexus. This patch adds the initial LIO callouts. The next patch will modify iblock. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig --- drivers/target/target_core_pr.c | 62 +++- include/target/target_core_backend.h | 4 ++ 2 files changed, 65

[dm-devel] [PATCH v5 11/18] nvme: Add pr_ops read_keys support

2023-03-26 Thread Mike Christie
just returns the registered keys which is required by the SCSI PR in READ KEYS command. Signed-off-by: Mike Christie --- drivers/nvme/host/pr.c | 69 ++ include/linux/nvme.h | 4 +++ 2 files changed, 73 insertions(+) diff --git a/drivers/nvme/host/pr.c b

[dm-devel] [PATCH v5 12/18] nvme: Add a nvme_pr_type enum

2023-03-26 Thread Mike Christie
function. Signed-off-by: Mike Christie Reviewed-by: Chaitanya Kulkarni Reviewed-by: Christoph Hellwig --- drivers/nvme/host/pr.c | 24 include/linux/nvme.h | 9 + 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/drivers/nvme/host/pr.c b/drivers

[dm-devel] [PATCH v5 02/18] block: Rename BLK_STS_NEXUS to BLK_STS_RESV_CONFLICT

2023-03-26 Thread Mike Christie
. Signed-off-by: Mike Christie Acked-by: Stefan Haberland --- block/blk-core.c | 2 +- drivers/nvme/host/core.c | 2 +- drivers/s390/block/dasd.c | 7 ++- drivers/scsi/scsi_lib.c | 2 +- include/linux/blk_types.h | 4 ++-- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git

[dm-devel] [PATCH v5 13/18] nvme: Add pr_ops read_reservation support

2023-03-26 Thread Mike Christie
This patch adds support for the pr_ops read_reservation callout by calling the NVMe Reservation Report helper. It then parses that info to detect if there is a reservation and if there is then convert the returned info to a pr_ops pr_held_reservation struct. Signed-off-by: Mike Christie Reviewed

[dm-devel] [PATCH v5 14/18] scsi: target: Rename sbc_ops to exec_cmd_ops

2023-03-26 Thread Mike Christie
The next patches allow us to call the block layer's pr_ops from the backends. This will require allowing the backends to hook into the cmd processing for SPC commands, so this renames sbc_ops to a more generic exec_cmd_ops. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig

[dm-devel] [PATCH v5 10/18] nvme: Add helper to send pr command

2023-03-26 Thread Mike Christie
Move the code that checks for multipath support and sends the pr command to a new helper so it can be used by the reservation report support added in the next patches. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig --- drivers/nvme/host/pr.c | 23 ++- 1 file

[dm-devel] [PATCH v5 06/18] dm: Add support for block PR read keys/reservation

2023-03-26 Thread Mike Christie
This adds support in dm for the block PR read keys and read reservation callouts. Signed-off-by: Mike Christie --- drivers/md/dm.c | 69 + 1 file changed, 69 insertions(+) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index f5cc330bb549

[dm-devel] [PATCH v5 05/18] scsi: Add support for block PR read keys/reservation

2023-03-26 Thread Mike Christie
This adds support in sd.c for the block PR read keys and read reservation callouts, so upper layers like LIO can get the PR info that's been setup using the existing pr callouts and return it to initiators. Signed-off-by: Mike Christie Reviewed-by: Chaitanya Kulkarni Reviewed-by: Christoph

[dm-devel] [PATCH v5 09/18] nvme: Move pr code to it's own file

2023-03-26 Thread Mike Christie
This patch moves the pr code to it's own file because I'm going to be adding more functions and core.c is getting bigger. Signed-off-by: Mike Christie Reviewed-by: Chaitanya Kulkarni Reviewed-by: Keith Busch --- drivers/nvme/host/Makefile | 2 +- drivers/nvme/host/core.c | 148

[dm-devel] [PATCH v5 03/18] scsi: Rename sd_pr_command

2023-03-26 Thread Mike Christie
Rename sd_pr_command to sd_pr_out_command to match a sd_pr_in_command helper added in the next patches. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni --- drivers/scsi/sd.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff

[dm-devel] [PATCH v5 08/18] nvme: Don't hardcode the data len for pr commands

2023-03-26 Thread Mike Christie
Reservation Report support needs to pass in a variable sized buffer, so this patch has the pr command helpers take a data length argument. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Chaitanya Kulkarni --- drivers/nvme/host/core.c | 13

[dm-devel] [PATCH v5 07/18] nvme: Fix reservation status related structs

2023-03-26 Thread Mike Christie
-by: Mike Christie --- include/linux/nvme.h | 38 ++ 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/include/linux/nvme.h b/include/linux/nvme.h index 779507ac750b..83704fc04a94 100644 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h @@ -759,20

Re: [dm-devel] [PATCH v4 07/18] nvme: Fix reservation status related structs

2023-03-21 Thread Mike Christie
On 3/15/23 12:40 AM, Christoph Hellwig wrote: > On Tue, Mar 14, 2023 at 05:23:16PM -0500, Mike Christie wrote: >> We could do separate structs though: > > I suspect that's probably better in the long run, as the [0] notation > is on its way out. Ok. I was able to use th

Re: [dm-devel] [PATCH v4 02/18] block: Rename BLK_STS_NEXUS to BLK_STS_RESV_CONFLICT

2023-03-21 Thread Mike Christie
On 3/20/23 8:06 AM, Christoph Hellwig wrote: > On Thu, Mar 16, 2023 at 11:36:12AM -0500, Mike Christie wrote: >> I think we are ok for dasd using BLK_STS_RESV_CONFLICT. >> >> It thought it sounded similar to SCSI/NVMe and userspace will still >> see -EBADE beca

Re: [dm-devel] [PATCH v4 02/18] block: Rename BLK_STS_NEXUS to BLK_STS_RESV_CONFLICT

2023-03-19 Thread Mike Christie
On 3/16/23 5:17 AM, Stefan Haberland wrote: > Am 15.03.23 um 14:30 schrieb Christoph Hellwig: >> On Wed, Mar 15, 2023 at 11:04:22AM +0100, Stefan Haberland wrote: >>> This also fits for the DASD case. We use this error code for a >>> reservation/locking conflict of the DASD device when the lock we

Re: [dm-devel] [PATCH v4 07/18] nvme: Fix reservation status related structs

2023-03-15 Thread Mike Christie
On 3/14/23 12:15 PM, Christoph Hellwig wrote: > On Fri, Feb 24, 2023 at 11:44:51AM -0600, Mike Christie wrote: >> +__u8resv10[14]; >> +union { >> +struct { >> +__u8rsvd24[40]; >> +struct nvme

Re: [dm-devel] [PATCH v4 13/18] nvme: Add pr_ops read_reservation support

2023-03-06 Thread Mike Christie
On 2/24/23 3:04 PM, kernel test robot wrote: > >drivers/nvme/host/pr.c: In function 'block_pr_type_from_nvme': >>> drivers/nvme/host/pr.c:43:24: warning: implicit conversion from 'enum >>> nvme_pr_type' to 'enum pr_type' [-Wenum-conversion] > 43 | return

Re: [dm-devel] [PATCH v4 10/18] nvme: Add helper to send pr command

2023-03-06 Thread Mike Christie
On 3/5/23 3:28 PM, Chaitanya Kulkarni wrote: >> >> +static int nvme_send_pr_command(struct block_device *bdev, >> +struct nvme_command *c, void *data, unsigned int data_len) >> +{ >> +if (IS_ENABLED(CONFIG_NVME_MULTIPATH) && >> +bdev->bd_disk->fops == _ns_head_ops) >> +

[dm-devel] [PATCH v4 01/18] Use block pr_ops in LIO

2023-02-26 Thread Mike Christie
The patches in this thread allow us to use the block pr_ops with LIO's target_core_iblock module to support cluster applications in VMs. They were built over Linus's tree. They also apply over linux-next and Martin's tree. They could also apply over Jens's tree but it needs the scsi_execute_cmd

[dm-devel] [PATCH v4 08/18] nvme: Don't hardcode the data len for pr commands

2023-02-26 Thread Mike Christie
Reservation Report support needs to pass in a variable sized buffer, so this patch has the pr command helpers take a data length argument. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Chaitanya Kulkarni --- drivers/nvme/host/core.c | 13

[dm-devel] [PATCH v4 15/18] scsi: target: Allow backends to hook into PR handling

2023-02-26 Thread Mike Christie
I_T nexus. This patch adds the initial LIO callouts. The next patch will modify iblock. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig --- drivers/target/target_core_pr.c | 62 +++- include/target/target_core_backend.h | 4 ++ 2 files changed, 65

[dm-devel] [PATCH v4 09/18] nvme: Move pr code to it's own file

2023-02-26 Thread Mike Christie
This patch moves the pr code to it's own file because I'm going to be adding more functions and core.c is getting bigger. Signed-off-by: Mike Christie Reviewed-by: Chaitanya Kulkarni Reviewed-by: Keith Busch --- drivers/nvme/host/Makefile | 2 +- drivers/nvme/host/core.c | 148

[dm-devel] [PATCH v4 05/18] scsi: Add support for block PR read keys/reservation

2023-02-26 Thread Mike Christie
This adds support in sd.c for the block PR read keys and read reservation callouts, so upper layers like LIO can get the PR info that's been setup using the existing pr callouts and return it to initiators. Signed-off-by: Mike Christie --- drivers/scsi/sd.c| 91

[dm-devel] [PATCH v4 13/18] nvme: Add pr_ops read_reservation support

2023-02-26 Thread Mike Christie
This patch adds support for the pr_ops read_reservation callout by calling the NVMe Reservation Report helper. It then parses that info to detect if there is a reservation and if there is then convert the returned info to a pr_ops pr_held_reservation struct. Signed-off-by: Mike Christie

[dm-devel] [PATCH v4 18/18] scsi: target: Add block PR support to iblock

2023-02-26 Thread Mike Christie
This adds support for the block PR callouts to target_core_iblock. This patch doesn't attempt to implement the entire spec because there's no way support it all like SPEC_I_PT and ALL_TG_PT. This only supports exporting the iblock device from one path on the local target. Signed-off-by: Mike

[dm-devel] [PATCH v4 17/18] scsi: target: Report and detect unsupported PR commands

2023-02-26 Thread Mike Christie
The backend modules don't know about ports and I_T nexuses and the pr_ops callouts the modules will use don't support the old RESERVE/RELEASE commands. This patch has us report we don't support those types of commands and fail them. Signed-off-by: Mike Christie --- drivers/target

[dm-devel] [PATCH v4 14/18] scsi: target: Rename sbc_ops to exec_cmd_ops

2023-02-26 Thread Mike Christie
The next patches allow us to call the block layer's pr_ops from the backends. This will require allowing the backends to hook into the cmd processing for SPC commands, so this renames sbc_ops to a more generic exec_cmd_ops. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig

[dm-devel] [PATCH v4 06/18] dm: Add support for block PR read keys/reservation

2023-02-26 Thread Mike Christie
This adds support in dm for the block PR read keys and read reservation callouts. Signed-off-by: Mike Christie --- drivers/md/dm.c | 43 +++ 1 file changed, 43 insertions(+) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index eace45a18d45..4abf640f1e7e

[dm-devel] [PATCH v4 03/18] scsi: Rename sd_pr_command

2023-02-26 Thread Mike Christie
Rename sd_pr_command to sd_pr_out_command to match a sd_pr_in_command helper added in the next patches. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni --- drivers/scsi/sd.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff

[dm-devel] [PATCH v4 02/18] block: Rename BLK_STS_NEXUS to BLK_STS_RESV_CONFLICT

2023-02-26 Thread Mike Christie
BLK_STS_NEXUS is used for NVMe/SCSI reservation conflicts or in dasd's case something similar. This renames BLK_STS_NEXUS so it better reflects this. Signed-off-by: Mike Christie Cc: Stefan Haberland Cc: Jan Hoeppner --- block/blk-core.c | 2 +- drivers/nvme/host/core.c | 2

[dm-devel] [PATCH v4 07/18] nvme: Fix reservation status related structs

2023-02-26 Thread Mike Christie
-by: Mike Christie Reviewed-by: Keith Busch --- include/linux/nvme.h | 33 + 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/include/linux/nvme.h b/include/linux/nvme.h index 4fad4aa245fb..c8c504926462 100644 --- a/include/linux/nvme.h +++ b/include/linux

[dm-devel] [PATCH v4 10/18] nvme: Add helper to send pr command

2023-02-26 Thread Mike Christie
Move the code that checks for multipath support and sends the pr command to a new helper so it can be used by the reservation report support added in the next patches. Signed-off-by: Mike Christie --- drivers/nvme/host/pr.c | 23 ++- 1 file changed, 14 insertions(+), 9

[dm-devel] [PATCH v4 01/18] block: Add PR callouts for read keys and reservation

2023-02-26 Thread Mike Christie
and NVMe's report reservation commands. Those are overkill for dm/LIO and READ_FULL_STATUS is sometimes broken for SCSI devices. Signed-off-by: Mike Christie --- include/linux/pr.h | 25 + 1 file changed, 25 insertions(+) diff --git a/include/linux/pr.h b/include/linux/pr.h

[dm-devel] [PATCH v4 12/18] nvme: Add a nvme_pr_type enum

2023-02-26 Thread Mike Christie
function. Signed-off-by: Mike Christie --- Note for Chaitanya, Keith and Bart. For these patches where we convert between block and nvme pr values, it seemed like Chaitanya and Keith didn't have a strong preference. Bart had the suggestion to keep the switch and drop the default so the compiler can

[dm-devel] [PATCH v4 04/18] scsi: Move sd_pr_type to header to share

2023-02-26 Thread Mike Christie
LIO is going to want to do the same block to/from SCSI pr types as sd.c so this moves the sd_pr_type helper to a new file. The next patch will then also add a helper to go from the SCSI value to the block one for use with PERSISTENT_RESERVE_IN commands. Signed-off-by: Mike Christie Reviewed

[dm-devel] [PATCH v4 11/18] nvme: Add pr_ops read_keys support

2023-02-26 Thread Mike Christie
just returns the registered keys which is required by the SCSI PR in READ KEYS command. Signed-off-by: Mike Christie --- drivers/nvme/host/pr.c | 65 ++ include/linux/nvme.h | 4 +++ 2 files changed, 69 insertions(+) diff --git a/drivers/nvme/host/pr.c b

Re: [dm-devel] [PATCH 1/2] multipath.conf(5): remove io-affinity information

2022-12-07 Thread Mike Christie
On 12/3/22 9:10 AM, Xose Vazquez Perez wrote: > On 11/30/22 05:56, bmarzins at redhat.com (Benjamin Marzinski) wrote: > >> The multpath-tools do not support the io-affinity path selector.  We >> always add a repeat count as the path argument. The io-affinity selector >> doesn't take one. Instead

Re: [dm-devel] [PATCH v3 12/19] block, nvme, scsi, dm: Add blk_status to pr_ops callouts

2022-11-07 Thread Mike Christie
On 11/1/22 5:15 AM, Christoph Hellwig wrote: > On Sun, Oct 30, 2022 at 06:05:35PM -0500, Mike Christie wrote: >> The problem I hit is that in the ioctl code I then have to do: >> >> @@ -269,7 +270,14 @@ static int blkdev_pr_register(struct block_device *bdev, >&

Re: [dm-devel] [PATCH v3 01/19] block: Add PR callouts for read keys and reservation

2022-11-03 Thread Mike Christie
On 11/2/22 5:53 PM, Bart Van Assche wrote: > On 10/26/22 16:19, Mike Christie wrote: >> +struct pr_keys { >> +    u32    generation; >> +    u32    num_keys; >> +    u64    keys[]; >> +}; > Is my understanding correct that keys[] is treated as opaque data by t

Re: [dm-devel] [PATCH v3 03/19] scsi: Move sd_pr_type to header to share

2022-11-03 Thread Mike Christie
On 11/2/22 5:47 PM, Bart Van Assche wrote: > On 10/26/22 16:19, Mike Christie wrote: >> +static inline enum scsi_pr_type block_pr_type_to_scsi(enum pr_type type) >> +{ >> +    switch (type) { >> +    case PR_WRITE_EXCLUSIVE: >> +    return SCSI

Re: [dm-devel] [PATCH v3 01/19] block: Add PR callouts for read keys and reservation

2022-11-03 Thread Mike Christie
On 11/2/22 5:50 PM, Bart Van Assche wrote: > On 10/26/22 16:19, Mike Christie wrote: >> +struct pr_keys { >> +    u32    generation; >> +    u32    num_keys; >> +    u64    keys[]; >> +}; >> + >> +struct pr_held_reservation { >> +    u64 

Re: [dm-devel] [PATCH v3 03/19] scsi: Move sd_pr_type to header to share

2022-11-02 Thread Mike Christie
On 11/1/22 12:43 AM, Chaitanya Kulkarni wrote: >> +static inline enum scsi_pr_type block_pr_type_to_scsi(enum pr_type type) >> +{ >> +switch (type) { >> +case PR_WRITE_EXCLUSIVE: >> +return SCSI_PR_WRITE_EXCLUSIVE; >> +case PR_EXCLUSIVE_ACCESS: >> +return

[dm-devel] [PATCH v3 17/19] scsi: target: Allow backends to hook into PR handling

2022-10-31 Thread Mike Christie
I_T nexus. This patch adds the initial LIO callouts. The next patch will modify iblock. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig --- drivers/target/target_core_pr.c | 60 include/target/target_core_backend.h | 5 +++ 2 files changed, 65

Re: [dm-devel] [PATCH v3 10/19] nvme: Move NVMe and Block PR types to an array

2022-10-31 Thread Mike Christie
On 10/27/22 10:18 AM, Keith Busch wrote: > On Wed, Oct 26, 2022 at 06:19:36PM -0500, Mike Christie wrote: >> For Reservation Report support we need to also convert from the NVMe spec >> PR type back to the block PR definition. This moves us to an array, so in >> the next pat

Re: [dm-devel] [PATCH v3 11/19] nvme: Add pr_ops read_reservation support

2022-10-31 Thread Mike Christie
On 10/30/22 3:18 AM, Christoph Hellwig wrote: >> +memset(resv, 0, sizeof(*resv)); > > Is there any good reason this isn't done by the caller? I will change it. I think it was leftover from when I was experimenting with some mulitpath support. It's not needed anymore. -- dm-devel mailing

Re: [dm-devel] [PATCH v3 08/19] nvme: Move pr code to it's own file

2022-10-31 Thread Mike Christie
On 10/27/22 12:06 PM, Keith Busch wrote: > On Wed, Oct 26, 2022 at 06:19:34PM -0500, Mike Christie wrote: >> This patch moves the pr code to it's own file because I'm going to be >> adding more functions and core.c is getting bigger. >> >> Signed-off-by: Mike Christie &

[dm-devel] [PATCH v3 01/19] block: Add PR callouts for read keys and reservation

2022-10-31 Thread Mike Christie
and NVMe's report reservation commands. Those are overkill for dm/LIO and READ_FULL_STATUS is sometimes broken for SCSI devices. Signed-off-by: Mike Christie --- include/linux/pr.h | 24 1 file changed, 24 insertions(+) diff --git a/include/linux/pr.h b/include/linux/pr.h

[dm-devel] [PATCH v3 12/19] block, nvme, scsi, dm: Add blk_status to pr_ops callouts

2022-10-31 Thread Mike Christie
value if the error is > 0. This patch just wires in the blk_status_t to the pr_ops callouts. The next patches will then have the drivers pass up a blk_status_t. Signed-off-by: Mike Christie --- block/ioctl.c| 11 ++- drivers/md/dm.c |

[dm-devel] [PATCH v3 09/19] nvme: Add pr_ops read_keys support

2022-10-31 Thread Mike Christie
the registered keys which is required by the SCSI PR in READ KEYS command. Signed-off-by: Mike Christie --- drivers/nvme/host/pr.c | 73 ++ include/linux/nvme.h | 4 +++ 2 files changed, 77 insertions(+) diff --git a/drivers/nvme/host/pr.c b/drivers/nvme

[dm-devel] [PATCH v3 05/19] dm: Add support for block PR read keys/reservation

2022-10-31 Thread Mike Christie
This adds support in dm for the block PR read keys and read reservation callouts. Signed-off-by: Mike Christie --- drivers/md/dm.c | 44 1 file changed, 44 insertions(+) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 95a1ee3d314e..f7f806890c92

Re: [dm-devel] [PATCH v3 12/19] block, nvme, scsi, dm: Add blk_status to pr_ops callouts

2022-10-31 Thread Mike Christie
On 10/30/22 3:20 AM, Christoph Hellwig wrote: > On Wed, Oct 26, 2022 at 06:19:38PM -0500, Mike Christie wrote: >> To handle both cases and keep userspace compatibility, this patch adds a >> blk_status_t arg to the pr_ops callouts. The lower levels will convert >> their

[dm-devel] [PATCH v3 04/19] scsi: Add support for block PR read keys/reservation

2022-10-31 Thread Mike Christie
This adds support in sd.c for the block PR read keys and read reservation callouts. Signed-off-by: Mike Christie --- drivers/scsi/sd.c| 104 +++ include/scsi/scsi_block_pr.h | 20 +++ include/scsi/scsi_proto.h| 5 ++ 3 files changed, 129

Re: [dm-devel] [PATCH v3 10/19] nvme: Move NVMe and Block PR types to an array

2022-10-31 Thread Mike Christie
On 10/27/22 12:16 PM, Keith Busch wrote: > On Thu, Oct 27, 2022 at 12:13:06PM -0500, michael.chris...@oracle.com wrote: >> Oh wait there was also a >> >> 3. The pr_types come from userspace so if it passes us 10 >> and we just do: >> >> types[pr_type] >> >> then we would crash due an out of bounds

[dm-devel] [PATCH v3 07/19] nvme: Don't hardcode the data len for pr commands

2022-10-31 Thread Mike Christie
Reservation Report support needs to pass in a variable sized buffer, so this patch has the pr command helpers take a data length argument. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig --- drivers/nvme/host/core.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions

[dm-devel] [PATCH v3 13/19] nvme: Have NVMe pr_ops return a blk_status_t

2022-10-31 Thread Mike Christie
the device/driver type and call a NVMe conversion function this has NVMe do the conversion and return a blk_status_t which the upper layer knows how to handle. Signed-off-by: Mike Christie --- drivers/nvme/host/core.c | 2 +- drivers/nvme/host/nvme.h | 1 + drivers/nvme/host/pr.c | 54

[dm-devel] [PATCH v3 15/19] scsi: Have sd pr_ops return a blk_status_t

2022-10-31 Thread Mike Christie
if needed. Signed-off-by: Mike Christie --- drivers/scsi/sd.c | 28 +++- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 8a39f25e4470..44d25194ff4e 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -1696,7 +1696,8

[dm-devel] [PATCH v3 06/19] nvme: Fix reservation status related structs

2022-10-31 Thread Mike Christie
-by: Mike Christie --- include/linux/nvme.h | 33 + 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/include/linux/nvme.h b/include/linux/nvme.h index 050d7d0cd81b..3ab141d982d1 100644 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h @@ -757,20 +757,37

[dm-devel] [PATCH v3 08/19] nvme: Move pr code to it's own file

2022-10-31 Thread Mike Christie
This patch moves the pr code to it's own file because I'm going to be adding more functions and core.c is getting bigger. Signed-off-by: Mike Christie --- drivers/nvme/host/Makefile | 2 +- drivers/nvme/host/core.c | 120 --- drivers/nvme/host/nvme.h | 2

[dm-devel] [PATCH v3 19/19] scsi: target: Add block PR support to iblock

2022-10-31 Thread Mike Christie
This adds support for the block PR callouts to target_core_iblock. This patch doesn't attempt to implement the entire spec because there's no way support it all like SPEC_I_PT and ALL_TG_PT. This only supports exporting the iblock device from one path on the local target. Signed-off-by: Mike

Re: [dm-devel] [PATCH v3 09/19] nvme: Add pr_ops read_keys support

2022-10-31 Thread Mike Christie
On 10/30/22 3:17 AM, Christoph Hellwig wrote: > On Wed, Oct 26, 2022 at 06:19:35PM -0500, Mike Christie wrote: >> This patch adds support for the pr_ops read_keys callout by calling the >> NVMe Reservation Report helper, then parsing that info to get the >> controller's reg

[dm-devel] [PATCH v3 03/19] scsi: Move sd_pr_type to header to share

2022-10-31 Thread Mike Christie
LIO is going to want to do the same block to/from SCSI pr types as sd.c so this moves the sd_pr_type helper to a new file. The next patch will then also add a helper to go from the SCSI value to the block one for use with PERSISTENT_RESERVE_IN commands. Signed-off-by: Mike Christie Reviewed

[dm-devel] [PATCH v3 02/19] scsi: Rename sd_pr_command

2022-10-31 Thread Mike Christie
Rename sd_pr_command to sd_pr_out_command to match a sd_pr_in_command helper added in the next patches. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig --- drivers/scsi/sd.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers

[dm-devel] [PATCH v3 00/19] Use block pr_ops in LIO

2022-10-31 Thread Mike Christie
The following patches were built over Linus's tree and this patchset https://lore.kernel.org/all/20221023030403.33845-24-michael.chris...@oracle.com/t/ which allows the SCSI layer passthrough users to control retries for commands like PRs used in this patchset. The patches in this thread allow

[dm-devel] [PATCH v3 16/19] scsi: target: Rename sbc_ops to exec_cmd_ops

2022-10-31 Thread Mike Christie
The next patches allow us to call the block layer's pr_ops from the backends. This will require allowing the backends to hook into the cmd processing for SPC commands, so this renames sbc_ops to a more generic exec_cmd_ops. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig

[dm-devel] [PATCH v3 14/19] scsi: Export scsi_result_to_blk_status

2022-10-31 Thread Mike Christie
Export scsi_result_to_blk_status so the sd pr_ops can get a BLK_STS error that can be returned to other kernel pr ops users. Signed-off-by: Mike Christie --- drivers/scsi/scsi_lib.c | 3 ++- include/scsi/scsi_cmnd.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers

[dm-devel] [PATCH v3 18/19] scsi: target: Don't support SCSI-2 RESERVE/RELEASE

2022-10-31 Thread Mike Christie
The pr_ops don't support SCSI-2 RESERVE/RELEASE so fail them during parsing. Signed-off-by: Mike Christie --- drivers/target/target_core_spc.c | 25 +++-- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/drivers/target/target_core_spc.c b/drivers/target

[dm-devel] [PATCH v3 11/19] nvme: Add pr_ops read_reservation support

2022-10-31 Thread Mike Christie
This patch adds support for the pr_ops read_reservation callout by calling the NVMe Reservation Report helper. It then parses that info to detect if there is a reservation and if there is then convert the returned info to a pr_ops pr_held_reservation struct. Signed-off-by: Mike Christie

[dm-devel] [PATCH v3 10/19] nvme: Move NVMe and Block PR types to an array

2022-10-31 Thread Mike Christie
For Reservation Report support we need to also convert from the NVMe spec PR type back to the block PR definition. This moves us to an array, so in the next patch we can add another helper to do the conversion without having to manage 2 switches. Signed-off-by: Mike Christie --- drivers/nvme

Re: [dm-devel] [PATCH v2 12/20] block, nvme, scsi, dm: Add blk_status to pr_ops callouts.

2022-08-09 Thread Mike Christie
On 8/9/22 2:33 PM, Bart Van Assche wrote: > On 8/9/22 11:08, Mike Christie wrote: >> On 8/9/22 2:21 AM, Christoph Hellwig wrote: >>> On Mon, Aug 08, 2022 at 07:04:11PM -0500, Mike Christie wrote: >>>> To handle both cases, this patch adds a blk_status_t arg to the p

Re: [dm-devel] [PATCH v2 04/20] scsi: Add support for block PR read keys/reservation.

2022-08-09 Thread Mike Christie
On 8/9/22 2:26 PM, Bart Van Assche wrote: > On 8/8/22 17:04, Mike Christie wrote: >> +static int sd_pr_in_command(struct block_device *bdev, u8 sa, >> +    unsigned char *data, int data_len) >> +{ >> +    struct scsi_disk *sdkp = scsi_disk(bdev->bd_dis

Re: [dm-devel] [PATCH v2 12/20] block, nvme, scsi, dm: Add blk_status to pr_ops callouts.

2022-08-09 Thread Mike Christie
On 8/9/22 2:21 AM, Christoph Hellwig wrote: > On Mon, Aug 08, 2022 at 07:04:11PM -0500, Mike Christie wrote: >> To handle both cases, this patch adds a blk_status_t arg to the pr_ops >> callouts. The lower levels will convert their device specific error to >> the blk_status_t

  1   2   >