nvme-fc: fix race between error recovery and creating association
authorMichael Liang <mliang@purestorage.com>
Fri, 7 Jul 2023 21:21:57 +0000 (15:21 -0600)
committerKeith Busch <kbusch@kernel.org>
Wed, 12 Jul 2023 16:29:51 +0000 (09:29 -0700)
commitee6fdc5055e916b1dd497f11260d4901c4c1e55e
tree7b46664c17da474c76c5bd70078f7853f499f490
parent60e445bdfccbb90c1bc13a92e128e50ba4357b3c
nvme-fc: fix race between error recovery and creating association

There is a small race window between nvme-fc association creation and error
recovery. Fix this race condition by protecting accessing to controller
state and ASSOC_FAILED flag under nvme-fc controller lock.

Signed-off-by: Michael Liang <mliang@purestorage.com>
Reviewed-by: Caleb Sander <csander@purestorage.com>
Reviewed-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/fc.c