linux-stable/include/scsi
Mike Christie 23d6fefbb3 scsi: iscsi: Fix in-kernel conn failure handling
Commit 0ab710458d ("scsi: iscsi: Perform connection failure entirely in
kernel space") has the following regressions/bugs that this patch fixes:

1. It can return cmds to upper layers like dm-multipath where that can
retry them. After they are successful the fs/app can send new I/O to the
same sectors, but we've left the cmds running in FW or in the net layer.
We need to be calling ep_disconnect if userspace is not up.

This patch only fixes the issue for offload drivers. iscsi_tcp will be
fixed in separate commit because it doesn't have a ep_disconnect call.

2. The drivers that implement ep_disconnect expect that it's called before
conn_stop. Besides crashes, if the cleanup_task callout is called before
ep_disconnect it might free up driver/card resources for session1 then they
could be allocated for session2. But because the driver's ep_disconnect is
not called it has not cleaned up the firmware so the card is still using
the resources for the original cmd.

3. The stop_conn_work_fn can run after userspace has done its recovery and
we are happily using the session. We will then end up with various bugs
depending on what is going on at the time.

We may also run stop_conn_work_fn late after userspace has called stop_conn
and ep_disconnect and is now going to call start/bind conn. If
stop_conn_work_fn runs after bind but before start, we would leave the conn
in a unbound but sort of started state where IO might be allowed even
though the drivers have been set in a state where they no longer expect
I/O.

4. Returning -EAGAIN in iscsi_if_destroy_conn if we haven't yet run the in
kernel stop_conn function is breaking userspace. We should have been doing
this for the caller.

Link: https://lore.kernel.org/r/20210525181821.7617-8-michael.christie@oracle.com
Fixes: 0ab710458d ("scsi: iscsi: Perform connection failure entirely in kernel space")
Reviewed-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-02 01:28:20 -04:00
..
fc scsi: scsi_transport_fc: Match HBA Attribute Length with HBAAPI V2.0 definitions 2020-07-15 14:50:23 -04:00
fc_frame.h scsi: libfc: Move scsi/fc_encode.h to libfc 2020-10-29 21:49:25 -04:00
fcoe_sysfs.h
iscsi_if.h scsi: iscsi: Add support for asynchronous iSCSI session destruction 2020-03-11 23:07:57 -04:00
iscsi_proto.h scsi: Fix spelling mistakes in header files 2021-05-21 17:22:45 -04:00
iser.h
libfc.h scsi: Fix spelling mistakes in header files 2021-05-21 17:22:45 -04:00
libfcoe.h Fix misc new gcc warnings 2021-04-27 17:05:53 -07:00
libiscsi.h scsi: iscsi: Stop queueing during ep_disconnect 2021-06-02 01:28:19 -04:00
libiscsi_tcp.h
libsas.h scsi: libsas: Remove temporarily-added _gfp() API variants 2021-01-22 21:31:10 -05:00
sas.h scsi: libsas: Replace zero-length array with flexible-array 2020-05-11 22:26:32 -04:00
sas_ata.h
scsi.h scsi: core: Treat device offline as a failure 2021-05-10 13:24:03 -04:00
scsi_bsg_iscsi.h scsi: Fix spelling mistakes in header files 2021-05-21 17:22:45 -04:00
scsi_cmnd.h SCSI misc on 20210428 2021-04-28 17:22:10 -07:00
scsi_common.h scsi: target: core: Add CONTROL field for trace events 2020-10-02 18:36:19 -04:00
scsi_dbg.h
scsi_device.h scsi: core: Remove an incorrect comment 2021-04-15 22:44:40 -04:00
scsi_devinfo.h
scsi_dh.h scsi: core: Introduce enum scsi_disposition 2021-04-15 22:44:40 -04:00
scsi_driver.h
scsi_eh.h scsi: core: Introduce enum scsi_disposition 2021-04-15 22:44:40 -04:00
scsi_host.h SCSI misc on 20210428 2021-04-28 17:22:10 -07:00
scsi_ioctl.h scsi: Replace zero-length array with flexible-array member 2020-03-11 23:07:56 -04:00
scsi_proto.h scsi: target: core: Add the VERSION DESCRIPTOR fields to the INQUIRY data 2021-05-15 14:34:26 -04:00
scsi_request.h
scsi_tcq.h scsi: core: Only return started requests from scsi_host_find_tag() 2020-07-24 22:09:56 -04:00
scsi_transport.h
scsi_transport_fc.h scsi: scsi_transport_fc: Add a new rport state FC_PORTSTATE_MARGINAL 2021-01-14 22:55:17 -05:00
scsi_transport_iscsi.h scsi: iscsi: Fix in-kernel conn failure handling 2021-06-02 01:28:20 -04:00
scsi_transport_sas.h
scsi_transport_spi.h
scsi_transport_srp.h
scsicam.h scsi: simplify scsi_partsize 2020-03-24 07:57:07 -06:00
sg.h scsi: Fix spelling mistakes in header files 2021-05-21 17:22:45 -04:00
srp.h scsi: Replace zero-length array with flexible-array member 2020-03-11 23:07:56 -04:00
viosrp.h