Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nvmet-fcloop: Do not wait on completion when unregister fails

The nvme_fc_unregister_localport() returns an error code in case that
the locaport pointer is NULL or has already been unegisterd. localport is
is either in the ONLINE state (all resources allocated) or has already
been put into DELETED state.

In this case we will never receive an wakeup call and thus any caller
will hang, e.g. module unload.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>

authored by

Daniel Wagner and committed by
Keith Busch
d97b4111 959ffef1

+2 -1
+2 -1
drivers/nvme/target/fcloop.c
··· 1166 1166 1167 1167 ret = nvme_fc_unregister_localport(lport->localport); 1168 1168 1169 - wait_for_completion(&lport->unreg_done); 1169 + if (!ret) 1170 + wait_for_completion(&lport->unreg_done); 1170 1171 1171 1172 kfree(lport); 1172 1173