From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bart Van Assche Subject: Re: [PATCH v2 04/15] IB/srp: Fail I/O fast if target offline Date: Mon, 01 Jul 2013 13:33:44 +0200 Message-ID: <51D16918.60600@acm.org> References: <51CD856A.3010102@acm.org> <51CD8676.6080205@acm.org> <51D146EE.6010209@profitbricks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <51D146EE.6010209-EIkl63zCoXaH+58JC4qpiA@public.gmane.org> Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Sebastian Riemer Cc: Roland Dreier , David Dillow , Vu Pham , linux-rdma List-Id: linux-rdma@vger.kernel.org On 07/01/13 11:07, Sebastian Riemer wrote: > On 28.06.2013 14:49, Bart Van Assche wrote: >> If reconnecting failed we know that no command completion will >> be received anymore. Hence let the SCSI error handler fail such >> commands immediately. >> >> Signed-off-by: Bart Van Assche >> Cc: Roland Dreier >> Cc: David Dillow >> Cc: Sebastian Riemer >> Cc: Vu Pham >> --- >> drivers/infiniband/ulp/srp/ib_srp.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c >> index 8c95262..5c91521 100644 >> --- a/drivers/infiniband/ulp/srp/ib_srp.c >> +++ b/drivers/infiniband/ulp/srp/ib_srp.c >> @@ -1755,6 +1755,8 @@ static int srp_abort(struct scsi_cmnd *scmnd) >> if (srp_send_tsk_mgmt(target, req->index, scmnd->device->lun, >> SRP_TSK_ABORT_TASK) == 0) >> ret = SUCCESS; >> + else if (target->transport_offline) >> + ret = FAST_IO_FAIL; >> else >> ret = FAILED; >> srp_free_req(target, req, scmnd, 0); >> > > This doesn't give us much speed advantage IMHO. The check for > target->transport_offline should be before calling srp_send_tsk_mgmt(). > > This way it would also match the patch description better. Hello Sebastian, Had you perhaps overlooked the following code at the start of srp_send_tsk_mgmt() ? if (!target->connected || target->qp_in_error) return -1; Given this I don't think it matters whether the transport_offline check occurs before or after the srp_send_tsk_mgmt() call. Bart. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html