]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
nvmet-fcloop: check all request and response have been processed
authorDaniel Wagner <wagi@kernel.org>
Tue, 28 Oct 2025 15:26:22 +0000 (16:26 +0100)
committerKeith Busch <kbusch@kernel.org>
Thu, 4 Dec 2025 22:46:08 +0000 (14:46 -0800)
When the remoteport or the targetport are removed check that there are
no inflight requests or responses.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Daniel Wagner <wagi@kernel.org>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/target/fcloop.c

index 5dffcc5becae86c79ef75a123647566b2dfc21f6..4e429a1ea2bd125c07cf17c972d4f34a94ccca70 100644 (file)
@@ -1111,8 +1111,10 @@ fcloop_remoteport_delete(struct nvme_fc_remote_port *remoteport)
        rport->nport->rport = NULL;
        spin_unlock_irqrestore(&fcloop_lock, flags);
 
-       if (put_port)
+       if (put_port) {
+               WARN_ON(!list_empty(&rport->ls_list));
                fcloop_nport_put(rport->nport);
+       }
 }
 
 static void
@@ -1130,8 +1132,10 @@ fcloop_targetport_delete(struct nvmet_fc_target_port *targetport)
        tport->nport->tport = NULL;
        spin_unlock_irqrestore(&fcloop_lock, flags);
 
-       if (put_port)
+       if (put_port) {
+               WARN_ON(!list_empty(&tport->ls_list));
                fcloop_nport_put(tport->nport);
+       }
 }
 
 #define        FCLOOP_HW_QUEUES                4