Target makes implicit LOGO on session teardown. LOGO ELS is not send on the
wire and initiator is not aware that target no longer wants talking to
it. Initiator keeps sending I/O requests, target responds with BA_RJT, they
time out and then initiator sends ABORT TASK (ABTS-LS).
Current behaviour incurs unneeded I/O timeout and can be fixed for some
initiators by making explicit LOGO on session deletion.
Link: https://lore.kernel.org/r/20191125165702.1013-3-r.bolshakov@yadro.com
Reviewed-by: Hannes Reinecke <hare@suse.de>
Tested-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 86196a8fa8a84af1395a28ea0548f2ce6ae9bc22 upstream ]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8730 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Commit 4fa183455988 ("scsi: qla2xxx: Utilize pci_alloc_irq_vectors/
pci_free_irq_vectors calls.") use pci_alloc_irq_vectors() to replace
pci_enable_msi() but it didn't handle the return value correctly. This bug
make qla2x00 always fail to setup MSI if MSI-X fail, so fix it.
BTW, improve the log message of return value in qla2x00_request_irqs() to
avoid confusion.
Fixes: 4fa183455988 ("scsi: qla2xxx: Utilize pci_alloc_irq_vectors/pci_free_irq_vectors calls.")
Cc: Michael Hernandez <michael.hernandez@cavium.com>
Link: https://lore.kernel.org/r/1574314847-14280-1-git-send-email-chenhc@lemote.com
Signed-off-by: Huacai Chen <chenhc@lemote.com>
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 45dc8f2d9c94ed74a5e31e63e9136a19a7e16081 upstream ]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8726 d57e44dd-8a1f-0410-8b47-8ef2f437770f
When ports are lost due to unzoning them, and the initiator port is
not part of any more zones, the GPN_FT command used for the fabric
scan may fail. In this case, the current code simply gives up after a
few retries. But if the zone is gone, all rports should actually be
marked as lost.
Fix this by jumping to the code that handles logout after GNN_FT after
scan retries are exhausted.
Fixes: f352eeb75419 ("scsi: qla2xxx: Add ability to use GPNFT/GNNFT for RSCN handling")
Link: https://lore.kernel.org/r/20191122221912.20100-3-martin.wilck@suse.com
Tested-by: Jason Orendorf <orendorf@hpe.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit c8a347931869bf4373bfd4036d297b8e11ab48ab upstream ]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8725 d57e44dd-8a1f-0410-8b47-8ef2f437770f
In nvme-fc: it's possible to have connected active controllers
and as no references are taken on the LLDD, the LLDD can be
unloaded. The controller would enter a reconnect state and as
long as the LLDD resumed within the reconnect timeout, the
controller would resume. But if a namespace on the controller
is the root device, allowing the driver to unload can be problematic.
To reload the driver, it may require new io to the boot device,
and as it's no longer connected we get into a catch-22 that
eventually fails, and the system locks up.
Fix this issue by taking a module reference for every connected
controller (which is what the core layer did to the transport
module). Reference is cleared when the controller is removed.
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
[ commit 863fbae929c7a5b64e96b8a3ffb34a29eefb9f8f upstream ]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8723 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Current code assumes abort will remove the original command from the active
list where scsi_done will not be called. Instead, the eh_abort thread will
do the scsi_done. That is not the case. Instead, we have a double
scsi_done calls triggering use after free.
Abort will tell FW to release the command from FW possesion. The original
command will return to ULP with error in its normal fashion via scsi_done.
eh_abort path would wait for the original command completion before
returning. eh_abort path will not perform the scsi_done call.
Fixes: 219d27d7147e0 ("scsi: qla2xxx: Fix race conditions in the code for aborting SCSI commands")
Cc: stable@vger.kernel.org # 5.2
Link: https://lore.kernel.org/r/20191105150657.8092-6-hmadhani@marvell.com
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Arun Easi <aeasi@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit f45bca8c5052e8c59bab64ee90c44441678b9a52 upstream ]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8715 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Current code will send PRLI with FC-NVMe bit set for the targets which
support only FCP. This may result into issue with targets which do not
understand NVMe and will go into a strange state. This patch would restart
the login process by going back to PLOGI state. The PLOGI state will force
the target to respond to correct PRLI request.
Fixes: c76ae845ea836 ("scsi: qla2xxx: Add error handling for PLOGI ELS passthrough")
Cc: stable@vger.kernel.org # 5.4
Link: https://lore.kernel.org/r/20191105150657.8092-2-hmadhani@marvell.com
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ commit 983f127603fac650fa34ee69db363e4615eaf9e7 upstream ]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8711 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This patch prevents that the following warning is reported when running the
libiscsi tests against the vdisk_blockio handler:
Refused bio with invalid length 4080 and/or offset 16.
WARNING: CPU: 3 PID: 16022 at /home/bvanassche/software/scst.git/scst/src/dev_handlers/scst_vdisk.c:6180 blockio_exec_rw+0xc89/0xcf0 [scst_vdisk]
Call Trace:
blockio_exec_write+0x9c/0xe0 [scst_vdisk]
vdev_do_job+0xe8/0x220 [scst_vdisk]
blockio_exec+0x140/0x370 [scst_vdisk]
scst_do_real_exec+0xf4/0x610 [scst]
scst_exec_check_blocking+0x24e/0x6b0 [scst]
scst_exec_check_sn+0x222/0x6c0 [scst]
scst_process_active_cmd+0xdff/0x31c0 [scst]
scst_cmd_thread+0x36f/0xb60 [scst]
kthread+0x1bc/0x210
ret_from_fork+0x24/0x30
See also https://github.com/sahlberg/libiscsi/issues/302.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8700 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Since this function is only used by the vdisk_fileio handler, reflect this
in the function name.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8699 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The exec_req_fifo patches have been removed some time ago. Hence also remove
the code that depends on these patches having been applied. See also commit
78d6da4517 ("scst: Remove obsolete exec_req_fifo kernel patches"; r8022).
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8698 d57e44dd-8a1f-0410-8b47-8ef2f437770f
pr_warning() has been removed from kernel v5.5. Hence use pr_warn() instead
of pr_warning().
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8697 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Instead of trying to fix the regressions introduced upstream, stay close
to the upstream code and let the upstream maintainers fix regressions.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8688 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Copying Module.symvers is the oldest supported method for building external
kernel modules that depend on another external kernel module. Since support
for that method will be removed from Linux kernel v5.5, use
KBUILD_EXTRA_SYMBOLS instead to specify the external symbols SCST kernel
modules depend on. Support for KBUILD_EXTRA_SYMBOLS was introduced in
upstream kernel v2.6.26 so this patch drops support for kernels before
v2.6.26.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8686 d57e44dd-8a1f-0410-8b47-8ef2f437770f