On Sat, Jun 16, 2018 at 02:23:10AM +0800, Zhu Lingshan wrote:
> These commits and the following intend to implement Persistent
> Reservation operations for TCMU devices.
Err, hell no.
If you are that tightly integrated with the target code that you can
implement persistent reservation you need
Hello Martin,
This patch series addresses the complaints reported by multiple static
source code analysis tools about the mpt3sas source code. Please consider
these patches for kernel v4.19.
Thanks,
Bart.
Changes compared to v1:
- Addressed Randy Dunlap's feedback about kernel-doc headers.
This patch avoids that smatch complains about a double unlock on
ioc->transport_cmds.mutex.
Fixes: 651a01364994 ("scsi: scsi_transport_sas: switch to bsg-lib for SMP
passthrough")
Signed-off-by: Bart Van Assche
Cc: Christoph Hellwig
Cc: Sathya Prakash
Cc: Chaitra P B
Cc: Suganath Prabu
Avoids that warnings about the kernel headers appear when building
with W=1. Remove useless "@Returns - Nothing" clauses. Change
"@Return - " into "Return: ".
Signed-off-by: Bart Van Assche
Cc: Sathya Prakash
Cc: Chaitra P B
Cc: Suganath Prabu Subramani
Cc: Randy Dunlap
---
This patch avoids that gcc complains about switch/case fall-through
when building with W=1.
Signed-off-by: Bart Van Assche
Cc: Sathya Prakash
Cc: Chaitra P B
Cc: Suganath Prabu Subramani
---
drivers/scsi/mpt3sas/mpt3sas_ctl.c | 1 +
drivers/scsi/mpt3sas/mpt3sas_scsih.c | 3 +++
2 files
Modify the indentation such that smatch no longer complains about
inconsistent indenting.
Signed-off-by: Bart Van Assche
Cc: Sathya Prakash
Cc: Chaitra P B
Cc: Suganath Prabu Subramani
---
drivers/scsi/mpt3sas/mpt3sas_base.c | 2 +-
drivers/scsi/mpt3sas/mpt3sas_scsih.c | 40
This patch does not change any functionality.
Signed-off-by: Bart Van Assche
Cc: Sathya Prakash
Cc: Chaitra P B
Cc: Suganath Prabu Subramani
---
drivers/scsi/mpt3sas/mpt3sas_base.c | 10 --
drivers/scsi/mpt3sas/mpt3sas_scsih.c | 5 -
2 files changed, 15 deletions(-)
diff --git
Since ioc->shost_recovery is set after ioc->reset_in_progress_mutex
is obtained, if concurrent resets are issued there is a short time
during which ioc->reset_in_progress_mutex is locked and
ioc->shost_recovery == 0. Avoid that this can cause trouble by
unconditionally locking ioc->shost_recovery.
Split each of these functions in three functions - one function
per reset phase. This patch does not change any functionality but
makes the code easier to read.
Note: it is much easier to review the git diff -w output after
having applied this patch than by reviewing the patch itself.
Make _base_build_nvme_prp() easier to read by introducing a structure
to access NVMe command fields.
Signed-off-by: Bart Van Assche
Cc: Sathya Prakash
Cc: Chaitra P B
Cc: Suganath Prabu Subramani
---
drivers/scsi/mpt3sas/mpt3sas_base.c | 13 -
drivers/scsi/mpt3sas/mpt3sas_base.h
Hi,
I am replying my own thread, if you want to test these commits, maybe
you need my tcmu-runner patch, I have attached, it works fine with PR
register, reserve, clear, release and preempt. Or you can use my repo
directly: https://github.com/ls-zhu/tcmu-runner/tree/rbd_v2_pr
It only works
This patch added a function tcmu_execute_pr_register_existing()
which will handle Persistent Reservation registration for a
currently registered IT_Nexus.
Signed-off-by: Zhu Lingshan
---
drivers/target/target_core_user.c | 34 +++
1 file changed, 34 insertions(+)
This patch added a function tcmu_pr_info_replace() which can
help update Persistent Reservation information stored on a
TCMU device. It will generate a new string based on the provided
struct tcmu_pr_info struct, then write it to the device.For example,
If we are using RBD, it will update PR info
This patch added functions to handle Persistent Reservation
Reserve against TCMU devices.
Function tcm_rbd_pr_info_rsv_set() will help set PR information
in struct tcmu_pr_info, function tcmu_execute_pr_reserve() will
help handle PR reserve requests against TCMU devices.
Signed-off-by: Zhu
When try to execute Persistent Reservation Read Keys,
but tcmu_pr_info_get() returns -ENODATA, this means there are no
registrations, so we should generate a fake empty struct
tcmu_pr_info, so that the code can keep running, but we don't
want to store it in the TCMU device, this is different from
This patch added a function tcmu_execute_pr_release()
to handle SCSI3 Persistent Reservation Release
for TCMU devices.
Signed-off-by: Zhu Lingshan
---
drivers/target/target_core_user.c | 119 ++
1 file changed, 119 insertions(+)
diff --git
This patch added a function tcmu_execute_pr_register() which
can help to handle Persistent Reservation register operation
for TCMU devices.
Signed-off-by: Zhu Lingshan
---
drivers/target/target_core_user.c | 138 ++
1 file changed, 138 insertions(+)
diff --git
This patch would enable the passthrough Persist Reservation
clear operation routine for TCMU devices.
If dev->passthrough_pr is 1, both dev->transport->pr_ops
and dev->transport->pr_ops->pr_clear are not NULL,
core_scsi3_emulate_pro_clear() will call
dev->transport->pr_ops->pr_clear to
This patch added a function tcmu_execute_pr_clear() which can
help perform Persistent Reservation clear operation,
this means clear reservations and registrations.
Signed-off-by: Zhu Lingshan
---
drivers/target/target_core_user.c | 108 ++
1 file changed, 108
This patch would enable the passthrough Persist Reservation
Release operation routine for TCMU devices.
If dev->passthrough_pr is 1, both dev->transport->pr_ops
and dev->transport->pr_ops->pr_release are not NULL,
core_scsi3_emulate_pro_release() will call
dev->transport->pr_ops->pr_release to
This patch added a struct target_pr_ops contains TCMU
Persistent Reservation operation functions. Added a
"struct target_pr_ops" type pointer in target_backend_ops,
so that we can call TCMU PR functions from struct
target_backend_ops.
Signed-off-by: Zhu Lingshan
---
This patch added netlink support for passthrough Persistent
Reservation information.
Signed-off-by: Zhu Lingshan
---
drivers/target/target_core_user.c | 35 +++
1 file changed, 35 insertions(+)
diff --git a/drivers/target/target_core_user.c
This patch would enable the passthrough Persist Reservation
Reserve operation routine for TCMU devices.
If dev->passthrough_pr is 1, both dev->transport->pr_ops
and dev->transport->pr_ops->pr_register are not NULL,
core_scsi3_emulate_pro_reserve() will call
dev->transport->pr_ops->pr_reserve to
This patch added a function tcmu_execute_pr_read_keys() which
can help handle Persistent Reservation Read Keys.
Signed-off-by: Zhu Lingshan
---
drivers/target/target_core_user.c | 74 +++
1 file changed, 74 insertions(+)
diff --git
This patch added a function is_passthrough_pr_supportive_dev()
to tell whether the device can support passthrough Persistent
Reservation, if supported, tcmu_configure_device() will set 1 to
dev->passthrough_pr to indicate it.
If dev->passthrough_pr is 1, both dev->transport->pr_ops
and
These commits and the following intend to implement Persistent
Reservation operations for TCMU devices.
This series of commits would implement such PR operations:
PR_Out_Register, PR_Out_Reserve, PR_Out_Clear, PR_Out_Preempt,
PR_Out_Release and PR_In_ReadKeys.
Next wave of patches will contain
This patch added a function tcmu_pr_info_get() which can help
get Persistent Reservation information from a TCMU device.
Signed-off-by: Zhu Lingshan
---
drivers/target/target_core_user.c | 51 +++
1 file changed, 51 insertions(+)
diff --git
This patch added a function tcmu_gen_it_nexus() which can help
generate a string contain IT_Nexus information from a session.
Signed-off-by: Zhu Lingshan
---
drivers/target/target_core_user.c | 44 +++
1 file changed, 44 insertions(+)
diff --git
This patch added a function tcmu_send_set_pr_info_event() to
store Persistent Reservation information into a TCMU
device (for example, if we use a RBD device, the information
will be stored in it's metadata), added it's wrapper function
tcmu_set_dev_pr_info() as well.
Signed-off-by: Zhu Lingshan
This patch added a function tcmu_pr_info_decode() which can decode
Persistent Reservation info, from the string to a struct
tcmu_pr_info. This function will call the pervious added decoder
like tcmu_pr_info_reg_decode() to do it's work.
Signed-off-by: Zhu Lingshan
---
This patch add two functions: tcmu_pr_info_rsv_decode() and
tcmu_pr_info_rsv_encode() to handle Persistent Reservations type,
key and IT_Nexus. This patch added a struct tcmu_pr_rsv to
store such information as well.
Signed-off-by: Zhu Lingshan
---
drivers/target/target_core_user.c | 72
When try to register an IT_Nexus, if tcmu_pr_info_get()
returns -ENODATA, this means the string stored on the
TCMU DEVICE records(for example, RBD metadata) which represent
Persistent Reservation information is empty,there are no
registrations, we should initialize a new struct
tcmu_pr_info.
This
This patch added a function tcmu_pr_info_encode() which can
encode Persistent Reservation info, from a struct tcmu_pr_info
to a string, so that we can store this string on a TCMU device.
This function will call the pervious added encoder like
tcmu_pr_info_reg_encode() to do it's work.
This patch added four functions: tcmu_pr_info_clear_reg() would
delete a registration from a struct tcmu_pr_info,
tcmu_pr_info_rsv_clear() would clear the reservation,
tcmu_is_rsv_holder() would check whether the registration is a
reservation holder. Then tcmu_pr_info_unregister_reg() would
call
This patch added a struct tcmu_pr_reg which contain Persistent
Reservation registrations information, also added two functions
tcmu_pr_info_reg_decode() and tcmu_pr_info_reg_encode() to handle
it.
Signed-off-by: Zhu Lingshan
---
drivers/target/target_core_user.c | 51
This patch added a function tcmu_execute_pr_register_new() which
can help to register an unregistered I_T Nexus.
Signed-off-by: Zhu Lingshan
---
drivers/target/target_core_user.c | 34 +++
1 file changed, 34 insertions(+)
diff --git
This patch added a function tcmu_pr_info_append_reg() which can
help to append a new Persistent Reservation registration to
struct tcmu_pr_info.
Signed-off-by: Zhu Lingshan
---
drivers/target/target_core_user.c | 20
1 file changed, 20 insertions(+)
diff --git
This patch added a function tcmu_pr_info_free() which can
help free struct tcmu_pr_info.
Signed-off-by: Zhu Lingshan
---
drivers/target/target_core_user.c | 14 ++
1 file changed, 14 insertions(+)
diff --git a/drivers/target/target_core_user.c
b/drivers/target/target_core_user.c
This patch added two functions: tcmu_pr_info_num_regs_decode()
and tcmu_pr_info_num_regs_encode() to handle the number of
Persistent Reservation registrations.
Signed-off-by: Zhu Lingshan
---
drivers/target/target_core_user.c | 34 +++
1 file changed, 34
This patch added two functions: tcmu_pr_info_gen_encode()
and tcmu_pr_info_gen_decode() to encode/decode the generations of
Persistent Reservations
Signed-off-by: Zhu Lingshan
---
drivers/target/target_core_user.c | 34 +++
1 file changed, 34 insertions(+)
diff
This patch added two functions: tcmu_pr_info_scsi2_rsv_encode()
and tcmu_pr_info_scsi2_rsv_decode() to encode and decode SCSI2
Reservations.
Signed-off-by: Zhu Lingshan
---
drivers/target/target_core_user.c | 65 +++
1 file changed, 65 insertions(+)
diff --git
This patch added three functions, tcmu_pr_info_vers_seq_encode()
to encode PR sequence and version into a string,
tcmu_pr_info_vers_decode() and tcmu_pr_info_seq_decode() used
to decode them.
Signed-off-by: Zhu Lingshan
---
drivers/target/target_core_user.c | 62 +++
This patch added a function tcmu_send_get_pr_info_event() to
get Persistent Reservation info from a TCMU device, added it's
wrapper function tcmu_get_dev_pr_info() as well.
Signed-off-by: Zhu Lingshan
---
drivers/target/target_core_user.c | 31 +++
1 file changed,
This patch added a struct tcmu_dev_pr_info, which can help
store the string buffer we got from a TCMU device record (for
example, for RBD devices, the records should be stored in
their metadata). So that we can decode / encode them.
Signed-off-by: Zhu Lingshan
---
On 2018-06-11 16:56:35 [+0200], Johannes Thumshirn wrote:
> Looks good,
> Reviewed-by: Johannes Thumshirn
Martin, what about this one?
Sebastian
On 2018-06-14 21:59:18 [-0400], Martin K. Petersen wrote:
>
> Sebastian,
Martin,
> Applied to 4.19/scsi-queue. Thank you!
Thank you.
Sebastian
46 matches
Mail list logo