> +static inline enum pr_type scsi_pr_type_to_block(enum scsi_pr_type type)
> +{
> + switch (type) {
> + case SCSI_PR_WRITE_EXCLUSIVE:
> + return PR_WRITE_EXCLUSIVE;
> + case SCSI_PR_EXCLUSIVE_ACCESS:
> + return PR_EXCLUSIVE_ACCESS;
> + case
On 10/26/22 16:19, Mike Christie wrote:
> 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
On 10/26/22 16:19, Mike Christie wrote:
> 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 ++--
>
Reviewed-by: Chaitanya Kulkarni
On 10/26/22 16:19, Mike Christie wrote:
> 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: Chaitanya Kulkarni
-ck
On 10/26/22 16:19, 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
> ---
>
Thanks a lot for doing this ...
Reviewed-by: Chaitanya Kulkarni
-ck
--
dm-devel
For the cases where you want to export a device to a VM via a single
I_T nexus and want to passthrough the PR handling to the physical/real
device you have to use pscsi or tcmu. Both are good for specific uses
however for the case where you want good performance, and are not using
SCSI devices
On Fri, Oct 28, 2022 at 11:06:29AM -0500, Mike Christie wrote:
> 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
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 patch we can add another
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
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 patch we can add another helper to do the conversion without
> having to
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
>
> Good idea.
Credit goes
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 optimize it's error handling so it can check if it's getting an error
because there's an existing reservation or if we need to retry different
LIO needs to be able to know if a failure was the result of a reservation
conflict and then be able to convert from the lower level's definition of
that error to SCSI so it can be returned to the initiator. Windows
clustering and test tools like libiscsi require this.
dm-multipath would also like
Hi
在 2022/10/30 23:31, Christoph Hellwig 写道:
We hold a reference to the holder kobject for each bd_holder_disk,
so to make the code a bit more robust, use a reference to it instead
of the block_device. As long as no one clears ->bd_holder_dir in
before freeing the disk, this isn't strictly
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 registered keys. Because the callout is only used in the
kernel where the callers do not know about controller/host IDs, the
callout just returns
The task status has been set to TASK_RUNNING in schedule(),
no need to set again here
Signed-off-by: lizhe
---
drivers/md/dm-crypt.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 159c6806c19b..dd82e5aad729 100644
---
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
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 device specific error to the
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
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
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
On Wed, Oct 26, 2022 at 06:19:32PM -0500, Mike Christie wrote:
> This fixes the following issues with the reservation status structs:
>
> 1. resv10 is bytes 23:10 so it should be 14 bytes.
> 2. regctl_ds only supports 64 bit host IDs.
>
> These are not currently used, but will be in this
If register or reserve hit a reservation conflict upper layers like LIO
need to pass that error to the initiator. To do this it has to know the
device/driver type so it can convert the return code because that's
currently a NVMe specific value. Instead of having the upper layers
figure out the
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 error.
>
> Similarly I thought there could be
If a register or reserve hit a reservation conflict upper layers like LIO
need to pass that error to the initiator. To do this it has to know the
device/driver type so it can convert the return code because that's
currently a device/driver specific value. Instead of having the upper
layers figure
This fixes the following issues with the reservation status structs:
1. resv10 is bytes 23:10 so it should be 14 bytes.
2. regctl_ds only supports 64 bit host IDs.
These are not currently used, but will be in this patchset which adds
support for the reservation report command.
Signed-off-by:
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
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
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 registered keys. Because
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-by:
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
On Wed, Oct 26, 2022 at 06:19:33PM -0500, Mike Christie wrote:
> 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
Looks good.
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
Good idea. The nvme core file is getting a bit too big and too diverse
in
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
On 10/27/22 12:06 PM, Mike Christie wrote:
> 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
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
---
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
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
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
---
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
---
40 matches
Mail list logo