Re: [PATCH-v2 1/3] target: Fix LUN_RESET active I/O handling for ACK_KREF

2016-01-28 Thread Sagi Grimberg
+ 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) { +

Re: [PATCH-v2 1/3] target: Fix LUN_RESET active I/O handling for ACK_KREF

2016-01-27 Thread Nicholas A. Bellinger
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 loo

Re: [PATCH-v2 1/3] target: Fix LUN_RESET active I/O handling for ACK_KREF

2016-01-26 Thread Christoph Hellwig
> +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

[PATCH-v2 1/3] target: Fix LUN_RESET active I/O handling for ACK_KREF

2016-01-22 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch fixes a NULL pointer se_cmd->cmd_kref < 0 refcount bug during TMR LUN_RESET with active se_cmd I/O, that can be triggered during se_cmd descriptor shutdown + release via core_tmr_drain_state_list() code. To address this bug, add common __target_check_io_state(