nvme-fc: fix module unloads while lports still pending
authorJames Smart <jsmart2021@gmail.com>
Sat, 29 Jun 2019 00:26:08 +0000 (17:26 -0700)
committerChristoph Hellwig <hch@lst.de>
Tue, 9 Jul 2019 21:37:05 +0000 (14:37 -0700)
commit4c73cbdff1119d088ed16d63def59ad32b11b18f
treece8b4906c1b8576e9a714edbdb35bcf059e5fd99
parent37c15219599f7a4baa73f6e3432afc69ba7cc530
nvme-fc: fix module unloads while lports still pending

Current code allows the module to be unloaded even if there are
pending data structures, such as localports and controllers on
the localports, that have yet to hit their reference counting
to remove them.

Fix by having exit entrypoint explicitly delete every controller,
which in turn will remove references on the remoteports and localports
causing them to be deleted as well. The exit entrypoint, after
initiating the deletes, will wait for the last localport to be deleted
before continuing.

Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/fc.c