From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx> Hi folks, Here is -v2 series to address two LUN_RESET active I/O + TMR se_cmd->cmd_kref < 0 bugs as reported recently by Quinn & Co. This bug can occur during active I/O remote port TMR LUN_RESET with multi-port LIO configurations. To address this bug, it adds __target_check_io_state() common handler for ABORT_TASK + LUN_RESET I/O abort cases, and moves remaining se_cmd SGL page + release into target_free_cmd_mem() to now be called directly from the final target_release_cmd_kref() callback. Following __target_check_io_state(), it also obtains kref_get_unless_zero(&se_cmd->cmd_kref) for TMR descs during LUN_RESET in core_tmr_drain_tmr_list(), in order to utilize common transport_wait_for_tasks() code when se_cmd + se_tmr_req descriptors are being aborted or shutdown. At this point the changes are able to survive multi-port active I/O LUN_RESET using iscsi-target ports against Linux + ESX hosts with TAS=1. Note there is still a known issue wrt multi-port active I/O LUN_RESET when se_session shutdown occurs at the same time, that I'm still groking and will need to be addressed for -v3 code. Quinn + Co, please have a look at qla2xxx + TAS with this series when you've got a moment, and let us know how active I/O LUN_RESET works with your test-case. Thank you, --nab v2 changes: - Fix TAS handling for multi-session se_node_acls - Change target_complete_cmd() to check for ABORTED || STOP - Avoid calling target_remove_from_state_list() with se_cmd->t_state_lock held in transport_cmd_check_stop() - Add missing target_free_cmd_mem() in target_put_sess_cmd() special case. - Add a more useful __target_check_io_state() comment - Use assert_spin_locked() + WARN_ON_ONCE() when necessary - Drop unnecessary !list_empty check Nicholas Bellinger (3): 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 drivers/target/target_core_tmr.c | 104 ++++++++++++++++++++++++--------- drivers/target/target_core_transport.c | 73 ++++++++++++++--------- include/target/target_core_base.h | 1 + 3 files changed, 122 insertions(+), 56 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