linux/include
Hou Pu 4e108d4f28 scsi: target: iscsi: Fix login error when receiving
iscsi_target_sk_data_ready() could be invoked indirectly by
iscsi_target_do_login_rx() from the workqueue like this:

iscsi_target_do_login_rx()
  iscsi_target_do_login()
    iscsi_target_do_tx_login_io()
      iscsit_put_login_tx()
        iscsi_login_tx_data()
          tx_data()
            sock_sendmsg_nosec()
              tcp_sendmsg()
                release_sock()
                  sk_backlog_rcv()
                    tcp_v4_do_rcv()
                      tcp_data_ready()
                        iscsi_target_sk_data_ready()

At that time LOGIN_FLAGS_READ_ACTIVE is not cleared and
iscsi_target_sk_data_ready will not read data from the socket. Some iscsi
initiators (libiscsi) will wait forever for a reply.

LOGIN_FLAGS_READ_ACTIVE should be cleared early just after doing the
receive and before writing to the socket in iscsi_target_do_login_rx.

Unfortunately, LOGIN_FLAGS_READ_ACTIVE is also used by sk_state_change to
do login cleanup if a socket was closed at login time. It is supposed to be
cleared after the login PDU is successfully processed and replied.

Introduce another flag, LOGIN_FLAGS_WRITE_ACTIVE, to cover the transmit
part.

Link: https://lore.kernel.org/r/20200716100212.4237-2-houpu@bytedance.com
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Hou Pu <houpu@bytedance.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-07-28 22:15:30 -04:00
..
acpi Merge branch 'acpica' 2020-06-10 17:27:28 +02:00
asm-generic The X86 entry, exception and interrupt code rework 2020-06-13 10:05:47 -07:00
clocksource
crypto
drm drm: remove drm specific kmap_atomic code 2020-06-04 19:06:22 -07:00
dt-bindings - qcom : 2020-06-11 12:42:14 -07:00
keys keys: Implement update for the big_key type 2020-06-02 17:22:31 +01:00
kunit
kvm
linux scsi: firmware: qcom_scm: Add support for programming inline crypto keys 2020-07-24 22:09:54 -04:00
math-emu
media media updates for v5.8-rc1 2020-06-13 13:09:38 -07:00
misc
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-06-13 16:27:13 -07:00
pcmcia
ras
rdma dynamic_debug: add an option to enable dynamic debug for modules only 2020-06-08 11:05:56 -07:00
scsi scsi: core: Only return started requests from scsi_host_find_tag() 2020-07-24 22:09:56 -04:00
soc pci-v5.8-changes 2020-06-06 11:01:58 -07:00
sound ASoC: Updates for v5.8 2020-06-01 20:26:07 +02:00
target scsi: target: iscsi: Fix login error when receiving 2020-07-28 22:15:30 -04:00
trace scsi: ufs: Add trace event for UIC commands 2020-06-15 23:35:06 -04:00
uapi scsi: qla2xxx: Change in PUREX to handle FPIN ELS requests 2020-07-01 22:24:16 -04:00
vdso
video
xen xen: Move xen_setup_callback_vector() definition to include/xen/hvm.h 2020-06-11 15:15:19 +02:00