Skip to content

Commit f9929c5

Browse files
igawkeithbusch
authored andcommitted
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>
1 parent 67582df commit f9929c5

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

drivers/nvme/target/fcloop.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,8 +1111,10 @@ fcloop_remoteport_delete(struct nvme_fc_remote_port *remoteport)
11111111
rport->nport->rport = NULL;
11121112
spin_unlock_irqrestore(&fcloop_lock, flags);
11131113

1114-
if (put_port)
1114+
if (put_port) {
1115+
WARN_ON(!list_empty(&rport->ls_list));
11151116
fcloop_nport_put(rport->nport);
1117+
}
11161118
}
11171119

11181120
static void
@@ -1130,8 +1132,10 @@ fcloop_targetport_delete(struct nvmet_fc_target_port *targetport)
11301132
tport->nport->tport = NULL;
11311133
spin_unlock_irqrestore(&fcloop_lock, flags);
11321134

1133-
if (put_port)
1135+
if (put_port) {
1136+
WARN_ON(!list_empty(&tport->ls_list));
11341137
fcloop_nport_put(tport->nport);
1138+
}
11351139
}
11361140

11371141
#define FCLOOP_HW_QUEUES 4

0 commit comments

Comments
 (0)