diff mbox series

ib_srp: Remove WARN_ON in srp_terminate_io()

Message ID 20181017070920.51934-1-hare@suse.de (mailing list archive)
State Superseded
Headers show
Series ib_srp: Remove WARN_ON in srp_terminate_io() | expand

Commit Message

Hannes Reinecke Oct. 17, 2018, 7:09 a.m. UTC
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 <hare@suse.com>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.com>
---
 drivers/infiniband/ulp/srp/ib_srp.c |  7 -------
 drivers/nvme/host/fc.c              | 10 ++++++++++
 2 files changed, 10 insertions(+), 7 deletions(-)

Comments

Christoph Hellwig Oct. 17, 2018, 7:10 a.m. UTC | #1
> 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 };

I don't think this belongs into the patch..
diff mbox series

Patch

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