- Mar 25, 2023
-
-
Martin K. Petersen authored
Mike Christie <michael.christie@oracle.com> says: The following patches apply over Martin's 6.4 branches and Linus's tree. They fix a couple regressions in iscsit that occur when there are TMRs executing and a connection is closed. It also includes Dimitry's fixes in related code paths for cmd cleanup when ERL2 is used and the write pending hang during conn cleanup. This version of the patchset brings it back to just regressions and fixes for bugs we have a lot of users hitting. I'm going to fix isert and get it hooked into iscsit properly in a second patchset, because this one was getting so large. I've also moved my cleanup type of patches for a 3rd patchset. Link: https://lore.kernel.org/r/20230319015620.96006-1-michael.christie@oracle.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Dmitry Bogdanov authored
Sometimes an initiator does not send data for a WRITE command and tries to abort it. The abort hangs waiting for frontend driver completion. iSCSI driver waits for data and that timeout eventually initiates connection reinstatment. The connection closing releases the commands in the connection, but those aborted commands still did not handle the abort and did not decrease a command ref counter. Because of that the connection reinstatement hangs indefinitely and prevents re-login for that initiator. Add handling in TCM of the abort for the WRITE_PENDING commands at connection closing moment to make it possible to release them. Signed-off-by:
Dmitry Bogdanov <d.bogdanov@yadro.com> [mnc: Rebase and expand comment] Signed-off-by:
Mike Christie <michael.christie@oracle.com> Link: https://lore.kernel.org/r/20230319015620.96006-10-michael.christie@oracle.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Mike Christie authored
Fix a bug added in commit f3619935 ("scsi: target: iscsi: Fix cmd abort fabric stop race"). If CMD_T_TAS is set on the se_cmd we must call iscsit_free_cmd() to do the last put on the cmd and free it, because the connection is down and we will not up sending the response and doing the put from the normal I/O path. Add a check for CMD_T_TAS in iscsit_release_commands_from_conn() so we now detect this case and run iscsit_free_cmd(). Fixes: f3619935 ("scsi: target: iscsi: Fix cmd abort fabric stop race") Signed-off-by:
Mike Christie <michael.christie@oracle.com> Link: https://lore.kernel.org/r/20230319015620.96006-9-michael.christie@oracle.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Mike Christie authored
This fixes a bug where an initiator thinks a LUN_RESET has cleaned up running commands when it hasn't. The bug was added in commit 51ec502a ("target: Delete tmr from list before processing"). The problem occurs when: 1. We have N I/O cmds running in the target layer spread over 2 sessions. 2. The initiator sends a LUN_RESET for each session. 3. session1's LUN_RESET loops over all the running commands from both sessions and moves them to its local drain_task_list. 4. session2's LUN_RESET does not see the LUN_RESET from session1 because the commit above has it remove itself. session2 also does not see any commands since the other reset moved them off the state lists. 5. sessions2's LUN_RESET will then complete with a successful response. 6. sessions2's inititor believes the running commands on its session are now cleaned up due to the successful response and cleans up the running commands from its side. It then restarts them. 7. The commands do eventually complete on the backend and the target starts to return aborted task statuses for them. The initiator will either throw a invalid ITT error or might accidentally lookup a new task if the ITT has been reallocated already. Fix the bug by reverting the patch, and serialize the execution of LUN_RESETs and Preempt and Aborts. Also prevent us from waiting on LUN_RESETs in core_tmr_drain_tmr_list, because it turns out the original patch fixed a bug that was not mentioned. For LUN_RESET1 core_tmr_drain_tmr_list can see a second LUN_RESET and wait on it. Then the second reset will run core_tmr_drain_tmr_list and see the first reset and wait on it resulting in a deadlock. Fixes: 51ec502a ("target: Delete tmr from list before processing") Signed-off-by:
Mike Christie <michael.christie@oracle.com> Link: https://lore.kernel.org/r/20230319015620.96006-8-michael.christie@oracle.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Dmitry Bogdanov authored
Commands from recovery entries are freed after session has been closed. That leads to use-after-free at command free or NPE with such call trace: Time2Retain timer expired for SID: 1, cleaning up iSCSI session. BUG: kernel NULL pointer dereference, address: 0000000000000140 RIP: 0010:sbitmap_queue_clear+0x3a/0xa0 Call Trace: target_release_cmd_kref+0xd1/0x1f0 [target_core_mod] transport_generic_free_cmd+0xd1/0x180 [target_core_mod] iscsit_free_cmd+0x53/0xd0 [iscsi_target_mod] iscsit_free_connection_recovery_entries+0x29d/0x320 [iscsi_target_mod] iscsit_close_session+0x13a/0x140 [iscsi_target_mod] iscsit_check_post_dataout+0x440/0x440 [iscsi_target_mod] call_timer_fn+0x24/0x140 Move cleanup of recovery enrties to before session freeing. Reported-by:
Forza <forza@tnonline.net> Signed-off-by:
Dmitry Bogdanov <d.bogdanov@yadro.com> Signed-off-by:
Mike Christie <michael.christie@oracle.com> Link: https://lore.kernel.org/r/20230319015620.96006-7-michael.christie@oracle.com Reviewed-by:
Maurizio Lombardi <mlombard@redhat.com> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Mike Christie authored
This fixes a bug added in commit f3619935 ("scsi: target: iscsi: Fix cmd abort fabric stop race"). If we have multiple sessions to the same se_device we can hit a race where a LUN_RESET on one session cleans up the se_cmds from under another session which is being closed. This results in the closing session freeing its conn/session structs while they are still in use. The bug is: 1. Session1 has IO se_cmd1. 2. Session2 can also have se_cmds for I/O and optionally TMRs for ABORTS but then gets a LUN_RESET. 3. The LUN_RESET on session2 sees the se_cmds on session1 and during the drain stages marks them all with CMD_T_ABORTED. 4. session1 is now closed so iscsit_release_commands_from_conn() only sees se_cmds with the CMD_T_ABORTED bit set and returns immediately even though we have outstanding commands. 5. session1's connection and session are freed. 6. The backend request for se_cmd1 completes and it accesses the freed connection/session. This hooks the iscsit layer into the cmd counter code, so we can wait for all outstanding se_cmds before freeing the connection. Fixes: f3619935 ("scsi: target: iscsi: Fix cmd abort fabric stop race") Signed-off-by:
Mike Christie <michael.christie@oracle.com> Link: https://lore.kernel.org/r/20230319015620.96006-6-michael.christie@oracle.com Reviewed-by:
Maurizio Lombardi <mlombard@redhat.com> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Mike Christie authored
This has iscsit allocate a per conn cmd counter and converts iscsit/isert to use it instead of the per session one. Signed-off-by:
Mike Christie <michael.christie@oracle.com> Link: https://lore.kernel.org/r/20230319015620.96006-5-michael.christie@oracle.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Mike Christie authored
Allow target_get_sess_cmd() users to pass in the cmd counter they want to use. Right now we pass in the session's cmd counter but in a subsequent commit iSCSI will switch from per session to per conn. Signed-off-by:
Mike Christie <michael.christie@oracle.com> Link: https://lore.kernel.org/r/20230319015620.96006-4-michael.christie@oracle.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Mike Christie authored
iSCSI needs to allocate its cmd counter per connection for MCS support where we need to stop and wait on commands running on a connection instead of per session. This moves the cmd counter allocation to target_setup_session() which is used by drivers that need the stop+wait behavior per session. xcopy doesn't need stop+wait at all, so we will be OK moving the cmd counter allocation outside of transport_init_session(). Signed-off-by:
Mike Christie <michael.christie@oracle.com> Link: https://lore.kernel.org/r/20230319015620.96006-3-michael.christie@oracle.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Mike Christie authored
iSCSI needs to wait on outstanding commands like how SRP and the FC/FCoE drivers do. It can't use target_stop_session() because for MCS support we can't stop the entire session during recovery because if other connections are OK then we want to be able to continue to execute I/O on them. Move the per session cmd counters to a new struct so iSCSI can allocate them per connection. The xcopy code can also just not allocate in the future since it doesn't need to track commands. Signed-off-by:
Mike Christie <michael.christie@oracle.com> Link: https://lore.kernel.org/r/20230319015620.96006-2-michael.christie@oracle.com Reviewed-by:
Maurizio Lombardi <mlombard@redhat.com> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Gustavo A. R. Silva authored
Zero-length arrays as fake flexible arrays are deprecated and we are moving towards adopting C99 flexible-array members instead. Address the following warning found with GCC-13 and -fstrict-flex-arrays=3 enabled: CC drivers/target/target_core_user.o drivers/target/target_core_user.c: In function ‘queue_cmd_ring’: drivers/target/target_core_user.c:1096:15: warning: array subscript 0 is outside array bounds of ‘struct iovec[0]’ [-Warray-bounds=] 1096 | iov = &entry->req.iov[0]; | ^~~~~~~~~~~~~~~~~~ In file included from drivers/target/target_core_user.c:31: ./include/uapi/linux/target_core_user.h:122:38: note: while referencing ‘iov’ 122 | struct iovec iov[0]; | ^~~ This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy() and help us make progress towards globally enabling -fstrict-flex-arrays=3 [1]. Link: https://github.com/KSPP/linux/issues/21 Link: https://github.com/KSPP/linux/issues/270 Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1] Signed-off-by:Gustavo A. R. Silva <gustavoars@kernel.org> Link: https://lore.kernel.org/r/ZBSchMvTdl7VObKI@work Reviewed-by:
Bodo Stroesser <bostroesser@gmail.com> Reviewed-by:
Kees Cook <keescook@chromium.org> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Jiapeng Chong authored
The variable transMethod is not used. Delete it. drivers/scsi/hpsa.c:9478:16: warning: variable 'transMethod' set but not used. Reported-by:
Abaci Robot <abaci@linux.alibaba.com> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4554 Signed-off-by:
Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Link: https://lore.kernel.org/r/20230317054940.86685-1-jiapeng.chong@linux.alibaba.com Acked-by:
Don Brace <don.brace@microchip.com> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
- Mar 17, 2023
-
-
Martin K. Petersen authored
Ranjan Kumar <ranjan.kumar@broadcom.com> says: Few Enhancements and minor fixes of mpi3mr driver. Link: https://lore.kernel.org/r/20230316110209.60145-1-ranjan.kumar@broadcom.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Ranjan Kumar authored
Update driver version to 8.4.1.0.0. Signed-off-by:
Ranjan Kumar <ranjan.kumar@broadcom.com> Signed-off-by:
Sreekanth Reddy <sreekanth.reddy@broadcom.com> Link: https://lore.kernel.org/r/20230316110209.60145-9-ranjan.kumar@broadcom.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Ranjan Kumar authored
Update copyright year from 2022 to 2023. Signed-off-by:
Ranjan Kumar <ranjan.kumar@broadcom.com> Signed-off-by:
Sreekanth Reddy <sreekanth.reddy@broadcom.com> Link: https://lore.kernel.org/r/20230316110209.60145-8-ranjan.kumar@broadcom.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Ranjan Kumar authored
Fix W=1 compilation warnings. Signed-off-by:
Ranjan Kumar <ranjan.kumar@broadcom.com> Signed-off-by:
Sreekanth Reddy <sreekanth.reddy@broadcom.com> Link: https://lore.kernel.org/r/20230316110209.60145-7-ranjan.kumar@broadcom.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Ranjan Kumar authored
Update MPI Headers to revision 27. Signed-off-by:
Ranjan Kumar <ranjan.kumar@broadcom.com> Signed-off-by:
Sreekanth Reddy <sreekanth.reddy@broadcom.com> Link: https://lore.kernel.org/r/20230316110209.60145-6-ranjan.kumar@broadcom.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Ranjan Kumar authored
SCSI error handling has taken place for timed out I/Os on a drive and the corresponding drive is removed. Stop escalating to higher level of reset by returning the TUR with "I_T NEXUS LOSS OCCURRED" sense key. Signed-off-by:
Ranjan Kumar <ranjan.kumar@broadcom.com> Signed-off-by:
Sreekanth Reddy <sreekanth.reddy@broadcom.com> Link: https://lore.kernel.org/r/20230316110209.60145-5-ranjan.kumar@broadcom.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Ranjan Kumar authored
Modify Message Unit Reset timeout value to 120 seconds from the previous value of 30 seconds. Signed-off-by:
Ranjan Kumar <ranjan.kumar@broadcom.com> Signed-off-by:
Sreekant Reddy <sreekanth.reddy@broadcom.com> Link: https://lore.kernel.org/r/20230316110209.60145-4-ranjan.kumar@broadcom.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Ranjan Kumar authored
After a soft reset, while setting up admin queue pairs, the driver initially sets admin request base and admin reply base addresses to NULL. This leads to DMA memory pointed by these pointers getting leaked. Signed-off-by:
Ranjan Kumar <ranjan.kumar@broadcom.com> Signed-off-by:
Sreekanth Reddy <sreekanth.reddy@broadcom.com> Link: https://lore.kernel.org/r/20230316110209.60145-3-ranjan.kumar@broadcom.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Ranjan Kumar authored
Upon Virtual disk removal, firmware sends device status change event (Virtual disk remove event) and expects the driver to start device remove handshake (by sending target reset and IOU control command to firmware). However, the driver does not initiate the device remove handshake which leads to the firmware fault. Signed-off-by:
Ranjan Kumar <ranjan.kumar@broadcom.com> Signed-off-by:
Sreekanth Reddy <sreekanth.reddy@broadcom.com> Link: https://lore.kernel.org/r/20230316110209.60145-2-ranjan.kumar@broadcom.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Krzysztof Kozlowski authored
The driver can match only via the DT table so the table should be always used and the of_match_ptr() does not make any sense (this also allows ACPI matching via PRP0001, even though it is not relevant here). drivers/ufs/host/ufs-hisi.c:561:34: error: ‘ufs_hisi_of_match’ defined but not used [-Werror=unused-const-variable=] Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230310214435.275127-3-krzysztof.kozlowski@linaro.org Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Krzysztof Kozlowski authored
The driver can match only via the DT table so the table should be always used and the of_match_ptr() does not make any sense (this also allows ACPI matching via PRP0001, even though it is not relevant here). drivers/ufs/host/ufs-exynos.c:1738:34: error: ‘exynos_ufs_of_match’ defined but not used [-Werror=unused-const-variable=] Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230310214435.275127-2-krzysztof.kozlowski@linaro.org Reviewed-by:
Alim Akhtar <alim.akhtar@samsung.com> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Krzysztof Kozlowski authored
The driver can be built on ACPI and its .of_match_table uses of_match_ptr(), thus annotate the actual table as maybe unused. Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230310214435.275127-1-krzysztof.kozlowski@linaro.org Reviewed-by:
Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Rob Herring authored
It is preferred to use typed property access functions (i.e. of_property_read_<type> functions) rather than low-level of_get_property()/of_find_property() functions for reading properties. Convert reading boolean properties to of_property_read_bool(). Signed-off-by:
Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20230310144723.1544999-1-robh@kernel.org Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Martin K. Petersen authored
Dmitry Bogdanov <d.bogdanov@yadro.com> says: The patchset is based on 6.4/scsi-staging branch. The first 11 patches are just a refactoring to reduce code duplication in fabric drivers. They make several callouts be optional in fabric ops. Make a default implementation of the optional ops and remove such implementations in the fabric drivers. The last patch is a new virtual remote fabric driver. It has a valueble sence with patchset "scsi: target: make RTPI an TPG identifier" to configure RPTI on remote/tpgt_x same as on tpgt_y on other nodes in a storage cluster. That allows to report the same ports in RTPG from each node and to have a clusterwide tpg/acl/lun view in kernel. Link: https://lore.kernel.org/r/20230313181110.20566-1-d.bogdanov@yadro.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Dmitry Bogdanov authored
Create virtual remote target module. This can be used to see a whole ACL/LUN/TPG configuration from all nodes in storage cluster. For example, it permits setting up remote ports in ALUA port groups. To report all ports in a cluster in REPORT TARGET PORT GROUP command. Suggested-by:
Konstantin Shelekhin <k.shelekhin@yadro.com> Signed-off-by:
Dmitry Bogdanov <d.bogdanov@yadro.com> Link: https://lore.kernel.org/r/20230313181110.20566-13-d.bogdanov@yadro.com Reviewed-by:
Mike Christie <michael.christie@oracle.com> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Dmitry Bogdanov authored
Remove callouts that are identical to the default implementations in TCM Core. Signed-off-by:
Dmitry Bogdanov <d.bogdanov@yadro.com> Link: https://lore.kernel.org/r/20230313181110.20566-12-d.bogdanov@yadro.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Dmitry Bogdanov authored
Remove callouts that are identical to the default implementations in TCM Core. Signed-off-by:
Dmitry Bogdanov <d.bogdanov@yadro.com> Link: https://lore.kernel.org/r/20230313181110.20566-11-d.bogdanov@yadro.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Dmitry Bogdanov authored
Remove callouts that are identical to the default implementations in TCM Core. Acked-by:
Juergen Gross <jgross@suse.com> Signed-off-by:
Dmitry Bogdanov <d.bogdanov@yadro.com> Link: https://lore.kernel.org/r/20230313181110.20566-10-d.bogdanov@yadro.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Dmitry Bogdanov authored
Remove callouts that are identical to the default implementations in TCM Core. Signed-off-by:
Dmitry Bogdanov <d.bogdanov@yadro.com> Link: https://lore.kernel.org/r/20230313181110.20566-9-d.bogdanov@yadro.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Dmitry Bogdanov authored
Remove callouts that are identical to the default implementations in TCM Core. Signed-off-by:
Dmitry Bogdanov <d.bogdanov@yadro.com> Link: https://lore.kernel.org/r/20230313181110.20566-8-d.bogdanov@yadro.com Acked-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Dmitry Bogdanov authored
Remove callouts that are identical to the default implementations in TCM Core. Signed-off-by:
Dmitry Bogdanov <d.bogdanov@yadro.com> Link: https://lore.kernel.org/r/20230313181110.20566-7-d.bogdanov@yadro.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Dmitry Bogdanov authored
Remove callouts that are identical to the default implementations in TCM Core. Signed-off-by:
Dmitry Bogdanov <d.bogdanov@yadro.com> Link: https://lore.kernel.org/r/20230313181110.20566-6-d.bogdanov@yadro.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Dmitry Bogdanov authored
Remove callouts that are identical to the default implementations in TCM Core. Signed-off-by:
Dmitry Bogdanov <d.bogdanov@yadro.com> Link: https://lore.kernel.org/r/20230313181110.20566-5-d.bogdanov@yadro.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Dmitry Bogdanov authored
Remove callouts that are identical to the default implementations in TCM Core. Signed-off-by:
Dmitry Bogdanov <d.bogdanov@yadro.com> Link: https://lore.kernel.org/r/20230313181110.20566-4-d.bogdanov@yadro.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Dmitry Bogdanov authored
Remove callouts that are identical to the default implementations in TCM Core. Signed-off-by:
Dmitry Bogdanov <d.bogdanov@yadro.com> Link: https://lore.kernel.org/r/20230313181110.20566-3-d.bogdanov@yadro.com Reviewed-by:
Bart Van Assche <bvanassche@acm.org> Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Dmitry Bogdanov authored
There are several callouts in target fabric ops that most of fabric drivers fill with a function returning the same value. Stop requiring such callouts to exist in the ops, fill them in TCM Core. Signed-off-by:
Dmitry Bogdanov <d.bogdanov@yadro.com> Link: https://lore.kernel.org/r/20230313181110.20566-2-d.bogdanov@yadro.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
Martin K. Petersen authored
John Garry <john.g.garry@oracle.com> says: This series contains a bunch of minor improvements to the driver. I have another bunch waiting with more major changes. Most of the changes are quite straightforward, and the only patches of note are as follows: - Fix the command abort feature, enabled with host option SDEBUG_OPT_CMD_ABORT. - Drop driver count of queued commands per device. - Add poll mode completions to statistics. We already have poll mode callback call count, so maybe it was intentional to omit poll mode from the statistics. Link: https://lore.kernel.org/r/20230313093114.1498305-1-john.g.garry@oracle.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
John Garry authored
Currently commands completed via poll mode are not included in the statistics gathering for deferred completions and missed CPUs. Poll mode completions should be treated the same as other deferred completion types, so add poll mode completions to the statistics. Signed-off-by:
John Garry <john.g.garry@oracle.com> Acked-by:
Douglas Gilbert <dgilbert@interlog.com> Link: https://lore.kernel.org/r/20230313093114.1498305-12-john.g.garry@oracle.com Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-