On Tue, 2016-01-26 at 18:19 +0100, Christoph Hellwig wrote: > > +static bool __target_check_io_state(struct se_cmd *se_cmd) > > +{ > > + struct se_session *sess = se_cmd->se_sess; > > + > > + assert_spin_locked(&se_session->sess_cmd_lock); > > + WARN_ON_ONCE(!irqs_disabled()); > > Btw, I looked a the code and can't really see what sess_cmd_lock is > supposed to protect here. > > > + sess = cmd->se_sess; > > + if (WARN_ON_ONCE(!sess)) > > + continue; > > + > > + spin_lock(&sess->sess_cmd_lock); > > + rc = __target_check_io_state(cmd); > > + spin_unlock(&sess->sess_cmd_lock); > > + if (!rc) { > > + printk("LUN_RESET I/O: non-zero kref_get_unless_zero\n"); > > + continue; > > + } > > And thus why we care about taking it here. I'm still working on -v3 series to handle se_session shutdown during this specific multi-port LUN_RESET case, and considering using the existing se_cmd->cmd_wait_set bit to signal when this special case happens. Currently ->sess_cmd_lock is held in target_release_cmd_kref() and target_sess_cmd_list_set_waiting() while checking and setting this value. -- 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