From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx> Hi folks, Here is -v4 series to address the set of of LUN_RESET active I/O + TMR se_cmd->cmd_kref < 0 bugs as reported recently by Quinn & Co. This can occur during active I/O remote port TMR LUN_RESET with multi-port LIO configurations. To address this bug, we add a __target_check_io_state() common handler for ABORT_TASK + LUN_RESET I/O abort cases, and move the remaining se_cmd SGL page + release into target_free_cmd_mem() to now be called directly from final target_release_cmd_kref() callback. It also adds a target_wait_free_cmd() helper and makes transport_generic_free_cmd() aware of CMD_T_ABORTED status during concurrent session disconnects, and introduces CMD_T_FABRIC_STOP bit to signal this special case. Currently this series is running atop v4.5-rc1 + v3.14.y, and with iscsi-target ports is able to survive active I/O remote-port LUN resets, plus remote-port LUN_RESET with concurrent simulated session disconnects. At this point the changes are stable with iscsi-target ports, and as Himanshu + Co can verify with tcm_qla2xxx should be considered ready to merge for -rc4. Please review + test. --nab v4 changes: - Add explicit CMD_T_FABRIC_STOP check and drop cmd_wait_set bit set usage in __target_check_io_state(). - Set early CMD_T_TAS in __target_check_io_state to avoid potential race in transport_send_task_abort() with shutdown. - Add fabric_stop + aborted checks in __transport_wait_for_tasks() in order to let TMR CMD_T_ABORTED se_cmd shutdown complete during concurrent session disconnect. - Fix race with driver SCF_SEND_DELAYED_TAS handling when __transport_check_aborted_status() could happen before transport_send_task_abort() in TMR kthread context. Nicholas Bellinger (5): target: Fix LUN_RESET active I/O handling for ACK_KREF target: Fix LUN_RESET active TMR descriptor handling target: Fix TAS handling for multi-session se_node_acls target: Fix remote-port TMR ABORT + se_cmd fabric stop target: Fix race with SCF_SEND_DELAYED_TAS handling drivers/target/target_core_tmr.c | 139 ++++++++++++----- drivers/target/target_core_transport.c | 278 +++++++++++++++++++++++---------- include/target/target_core_base.h | 3 + 3 files changed, 301 insertions(+), 119 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html