From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH-v3 1/5] target: Fix LUN_RESET active I/O handling for ACK_KREF Date: Tue, 2 Feb 2016 10:37:41 +0100 Message-ID: <20160202093741.GA26933@lst.de> References: <1454132222-29009-1-git-send-email-nab@daterainc.com> <1454132222-29009-2-git-send-email-nab@daterainc.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1454132222-29009-2-git-send-email-nab@daterainc.com> Sender: target-devel-owner@vger.kernel.org To: "Nicholas A. Bellinger" Cc: target-devel , linux-scsi , Quinn Tran , Himanshu Madhani , Sagi Grimberg , Christoph Hellwig , Hannes Reinecke , Andy Grover , Mike Christie , Nicholas Bellinger List-Id: linux-scsi@vger.kernel.org > @@ -282,6 +305,16 @@ static void core_tmr_drain_state_list( > if (prout_cmd == cmd) > continue; > > + 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) > + continue; > + I still don't understand why we care about the session or sess_cmd_lock here. There isn't anything in __target_check_io_state that relies on them (except for the assert checking the lock).