From patchwork Mon Jul 8 18:42:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 2824980 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6D39EC0AB2 for ; Mon, 8 Jul 2013 18:43:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2DFF820163 for ; Mon, 8 Jul 2013 18:43:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1284620165 for ; Mon, 8 Jul 2013 18:43:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752925Ab3GHSnF (ORCPT ); Mon, 8 Jul 2013 14:43:05 -0400 Received: from juliette.telenet-ops.be ([195.130.137.74]:50756 "EHLO juliette.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752832Ab3GHSnE (ORCPT ); Mon, 8 Jul 2013 14:43:04 -0400 Received: from [192.168.1.101] ([178.119.235.68]) by juliette.telenet-ops.be with bizsmtp id xuj01l01E1VD9XW06uj01m; Mon, 08 Jul 2013 20:43:01 +0200 Message-ID: <51DB0833.3030908@acm.org> Date: Mon, 08 Jul 2013 20:42:59 +0200 From: Bart Van Assche User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Vu Pham CC: David Dillow , Roland Dreier , Sebastian Riemer , Jinpu Wang , linux-rdma , linux-scsi , James Bottomley Subject: Re: [PATCH v3 07/13] scsi_transport_srp: Add transport layer error handling References: <51D41C03.4020607@acm.org> <51D41F13.6060203@acm.org> <1372864458.24238.32.camel@frustration.ornl.gov> <51D44A86.5050000@acm.org> <1372872474.24238.43.camel@frustration.ornl.gov> <51DAF63D.9010906@mellanox.com> In-Reply-To: <51DAF63D.9010906@mellanox.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 07/08/13 19:26, Vu Pham wrote: > After running cable pull test on two local IB links for several hrs, > I/Os got stuck. > Further commands "multipath -ll" or "fdisk -l" got stuck and never return > Here are the stack dump for srp-x kernel threads. > I'll run with #DEBUG to get more debug info on scsi host & rport Hello Vu, I had a quick look at the stack dump that was attached to your e-mail. It shows that scsi_execute_req() hangs in blk_execute_rq(). It would be appreciated if you could continue your tests with the kernel patch below applied on top of v3 of this patch series. This patch should avoid that a transport layer error that occurs after device removal has started can cause the SCSI device state to change into "blocked". This patch also causes such TL errors to fail I/O quickly (scsi_host_alloc() zero- initializes the memory it allocates so no explicit initialization of the "deleted" variable is necessary). Thanks, Bart. --- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_transport_srp.c index 1b9ebd5..1bb7c63 100644 --- a/drivers/scsi/scsi_transport_srp.c +++ b/drivers/scsi/scsi_transport_srp.c @@ -522,6 +522,12 @@ void srp_start_tl_fail_timers(struct srp_rport *rport) int fast_io_fail_tmo, dev_loss_tmo, delay; mutex_lock(&rport->mutex); + if (rport->deleted) { + srp_rport_set_state(rport, SRP_RPORT_FAIL_FAST); + scsi_target_unblock(&shost->shost_gendev, + SDEV_TRANSPORT_OFFLINE); + goto unlock; + } delay = rport->reconnect_delay; fast_io_fail_tmo = rport->fast_io_fail_tmo; dev_loss_tmo = rport->dev_loss_tmo; @@ -542,6 +548,7 @@ void srp_start_tl_fail_timers(struct srp_rport *rport) if (dev_loss_tmo >= 0) queue_delayed_work(system_long_wq, &rport->dev_loss_work, 1UL * dev_loss_tmo * HZ); +unlock: mutex_unlock(&rport->mutex); } EXPORT_SYMBOL(srp_start_tl_fail_timers); @@ -730,6 +737,7 @@ void srp_rport_del(struct srp_rport *rport) mutex_lock(&rport->mutex); if (rport->state == SRP_RPORT_BLOCKED) __rport_fast_io_fail_timedout(rport); + rport->deleted = true; mutex_unlock(&rport->mutex); put_device(dev); diff --git a/include/scsi/scsi_transport_srp.h b/include/scsi/scsi_transport_srp.h index fbcc985..a4addcf 100644 --- a/include/scsi/scsi_transport_srp.h +++ b/include/scsi/scsi_transport_srp.h @@ -54,6 +54,7 @@ struct srp_rport { int dev_loss_tmo; struct delayed_work fast_io_fail_work; struct delayed_work dev_loss_work; + bool deleted; }; struct srp_function_template {