linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH-v2 0/3] target: Fix LUN_RESET active I/O + TMR handling
@ 2016-01-23  1:37 Nicholas A. Bellinger
  2016-01-23  1:37 ` [PATCH-v2 1/3] target: Fix LUN_RESET active I/O handling for ACK_KREF Nicholas A. Bellinger
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Nicholas A. Bellinger @ 2016-01-23  1:37 UTC (permalink / raw)
  To: target-devel
  Cc: linux-scsi, Quinn Tran, Himanshu Madhani, Sagi Grimberg,
	Christoph Hellwig, Hannes Reinecke, Andy Grover, Mike Christie,
	Nicholas Bellinger

From: Nicholas Bellinger <nab@linux-iscsi.org>

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-01-28 17:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-23  1:37 [PATCH-v2 0/3] target: Fix LUN_RESET active I/O + TMR handling Nicholas A. Bellinger
2016-01-23  1:37 ` [PATCH-v2 1/3] target: Fix LUN_RESET active I/O handling for ACK_KREF Nicholas A. Bellinger
2016-01-26 17:19   ` Christoph Hellwig
2016-01-28  5:34     ` Nicholas A. Bellinger
2016-01-28 17:00   ` Sagi Grimberg
2016-01-23  1:37 ` [PATCH-v2 2/3] target: Fix LUN_RESET active TMR descriptor handling Nicholas A. Bellinger
2016-01-26 17:21   ` Christoph Hellwig
2016-01-23  1:37 ` [PATCH-v2 3/3] target: Fix TAS handling for multi-session se_node_acls Nicholas A. Bellinger
2016-01-26 17:22   ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).