From patchwork Wed Oct 17 07:09:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 10644797 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B5774157A for ; Wed, 17 Oct 2018 07:09:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A56642A263 for ; Wed, 17 Oct 2018 07:09:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 98EAC2A270; Wed, 17 Oct 2018 07:09:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3EE242A26A for ; Wed, 17 Oct 2018 07:09:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727297AbeJQPDj (ORCPT ); Wed, 17 Oct 2018 11:03:39 -0400 Received: from mx2.suse.de ([195.135.220.15]:59848 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727246AbeJQPDi (ORCPT ); Wed, 17 Oct 2018 11:03:38 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id E74F1ADF1; Wed, 17 Oct 2018 07:09:21 +0000 (UTC) From: Hannes Reinecke To: Jens Axboe Cc: "Martin K. Petersen" , Bart van Assche , Christoph Hellwig , James Bottomley , linux-scsi@vger.kernel.org, linux-rdma@vger.kernel.org, Hannes Reinecke , Hannes Reinecke Subject: [PATCH] ib_srp: Remove WARN_ON in srp_terminate_io() Date: Wed, 17 Oct 2018 09:09:20 +0200 Message-Id: <20181017070920.51934-1-hare@suse.de> X-Mailer: git-send-email 2.16.4 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The WARN_ON() is pointless as the rport is placed in SDEV_TRANSPORT_OFFLINE at that time, so no new commands can be submitted via srp_queuecommand() Signed-off-by: Hannes Reinecke Reviewed-by: Jens Axboe Reviewed-by: Johannes Thumshirn --- drivers/infiniband/ulp/srp/ib_srp.c | 7 ------- drivers/nvme/host/fc.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 0b34e909505f..5a79444c2f3c 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -1334,13 +1334,6 @@ static void srp_terminate_io(struct srp_rport *rport) struct scsi_device *sdev; int i, j; - /* - * Invoking srp_terminate_io() while srp_queuecommand() is running - * is not safe. Hence the warning statement below. - */ - shost_for_each_device(sdev, shost) - WARN_ON_ONCE(sdev->request_queue->request_fn_active); - for (i = 0; i < target->ch_count; i++) { ch = &target->ch[i]; diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index e52b9d3c0bd6..c777b36ba62a 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -483,6 +483,8 @@ nvme_fc_signal_discovery_scan(struct nvme_fc_lport *lport, char hostaddr[FCNVME_TRADDR_LENGTH]; /* NVMEFC_HOST_TRADDR=...*/ char tgtaddr[FCNVME_TRADDR_LENGTH]; /* NVMEFC_TRADDR=...*/ char *envp[4] = { "FC_EVENT=nvmediscovery", hostaddr, tgtaddr, NULL }; + char *aen_envp[5] = { "NVME_EVENT=discovery", "NVME_TRTYPE=fc", + hostaddr, tgtaddr, NULL }; if (!(rport->remoteport.port_role & FC_PORT_ROLE_NVME_DISCOVERY)) return; @@ -494,6 +496,14 @@ nvme_fc_signal_discovery_scan(struct nvme_fc_lport *lport, "NVMEFC_TRADDR=nn-0x%016llx:pn-0x%016llx", rport->remoteport.node_name, rport->remoteport.port_name); kobject_uevent_env(&fc_udev_device->kobj, KOBJ_CHANGE, envp); + /* Simulate Discovery AENs */ + snprintf(hostaddr, sizeof(hostaddr), + "NVME_TRADDR=nn-0x%016llx:pn-0x%016llx", + rport->remoteport.node_name, rport->remoteport.port_name); + snprintf(tgtaddr, sizeof(tgtaddr), + "NVME_HOST_TRADDR=nn-0x%016llx:pn-0x%016llx", + lport->localport.node_name, lport->localport.port_name); + kobject_uevent_env(&fc_udev_device->kobj, KOBJ_CHANGE, envp); } static void