nvmet-fcloop: check all request and response have been processed

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>
This commit is contained in:
Daniel Wagner 2025-10-28 16:26:22 +01:00 committed by Keith Busch
parent 67582dfd87
commit f9929c518d

View 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