linux/include
Mike Christie bee1e10216 scsi: iscsi: Fix in-kernel conn failure handling
[ Upstream commit 23d6fefbb3 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2021-07-14 17:07:33 +02:00
..
acpi Merge branches 'acpi-cppc', 'acpi-video' and 'acpi-utils' 2021-04-26 17:04:27 +02:00
asm-generic mm: define default MAX_PTRS_PER_* in include/pgtable.h 2021-07-14 17:06:38 +02:00
clocksource clocksource/drivers/timer-ti-dm: Save and restore timer TIOCP_CFG 2021-07-14 17:06:51 +02:00
crypto crypto: shash - avoid comparing pointers to exported functions under CFI 2021-07-14 17:06:26 +02:00
drm Merge drm/drm-fixes into drm-next 2021-04-13 23:15:09 +02:00
dt-bindings clk: imx8mq: remove SYS PLL 1/2 clock gates 2021-07-14 17:07:04 +02:00
keys integrity-v5.13 2021-05-01 15:32:18 -07:00
kunit kunit: fix -Wunused-function warning for __kunit_fail_current_test 2021-04-06 15:22:39 -06:00
kvm Merge branch 'kvm-arm64/kill_oprofile_dependency' into kvmarm-master/next 2021-04-22 13:41:49 +01:00
linux iio: cros_ec_sensors: Fix alignment of buffer in iio_push_to_buffers_with_timestamp() 2021-07-14 17:07:29 +02:00
math-emu treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
media media: Fix Media Controller API config checks 2021-07-14 17:06:29 +02:00
memory memory: renesas-rpc-if: Make rpcif_enable/disable_rpm() as static inline 2020-11-28 12:37:18 +01:00
misc ocxl: Update the Process Element Entry 2020-12-04 01:01:30 +11:00
net net: lwtunnel: handle MTU calculation in forwading 2021-07-14 17:07:23 +02:00
pcmcia pcmcia: Replace zero-length array with flexible-array 2020-05-18 10:28:31 +02:00
ras mm,hwpoison: introduce MF_MSG_UNSPLIT_THP 2020-10-16 11:11:17 -07:00
rdma RDMA/restrack: Add support to get resource tracking for SRQ 2021-04-22 10:30:27 -03:00
scsi scsi: iscsi: Fix in-kernel conn failure handling 2021-07-14 17:07:33 +02:00
soc Networking changes for 5.13. 2021-04-29 11:57:23 -07:00
sound ASoC: Fixes for v5.13 2021-05-25 08:58:01 +02:00
target scsi: target: core: Make completion affinity configurable 2021-03-04 17:37:03 -05:00
trace NFS client updates for Linux 5.13 2021-05-07 11:23:41 -07:00
uapi media: vicodec: Use _BITUL() macro in UAPI headers 2021-07-14 17:06:43 +02:00
vdso time64.h: Consolidated PSEC_PER_SEC definition 2021-04-06 16:32:17 -07:00
video video: fbdev: sstfb: Updated logging to fix set but not used warnings 2020-11-30 20:04:59 +01:00
xen xen/arm: move xen_swiotlb_detect to arm/swiotlb-xen.h 2021-05-14 15:52:05 +02:00