nvme-fcloop: Fix dropped LS's to removed target port
authorJames Smart <jsmart2021@gmail.com>
Thu, 9 Aug 2018 23:00:14 +0000 (16:00 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Oct 2018 00:00:59 +0000 (17:00 -0700)
commitd11237bdcf9570edc0c562d93df219a4a8a4c9f0
treeb1ea7b5e587e9804325a6ead9392cb4eb8c5e1d7
parent516b72e36dedaac451a307f8e9a0ef82272d92fb
nvme-fcloop: Fix dropped LS's to removed target port

[ Upstream commit afd299ca996929f4f98ac20da0044c0cdc124879 ]

When a targetport is removed from the config, fcloop will avoid calling
the LS done() routine thinking the targetport is gone. This leaves the
initiator reset/reconnect hanging as it waits for a status on the
Create_Association LS for the reconnect.

Change the filter in the LS callback path. If tport null (set when
failed validation before "sending to remote port"), be sure to call
done. This was the main bug. But, continue the logic that only calls
done if tport was set but there is no remoteport (e.g. case where
remoteport has been removed, thus host doesn't expect a completion).

Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvme/target/fcloop.c