[PATCH 0/2] nvme-fc: enhance transport error handling when create associations

Michael Liang mliang at purestorage.com
Fri Jul 7 14:21:55 PDT 2023


Currently when there is some transport error happens during creating
nvme-fc association, nvme_fc_create_association() could return 0 status code
which implies the association creation was done successfully while it's
actually not. The consequence is the nvme controller could be stuck in
connecting state infinitely. Also there is a potential race condition
between transport io error recovery and the last ASSOC_FAILED check in
nvme_fc_create_association(). We may end up ignoring a transport error during
connecting creation.

Fix these two issues by:
1. Return non-zero status code(-EIO) when needed, so re-connecting
or deleting controller will be triggered properly;
2. Protect accessing to nvme-fc controller ASSOC_FAILED flag and nvme controller
state transition under nvme-fc controller's spin lock;

Michael Liang (2):
  nvme-fc: return non-zero status code when fails to create association
  nvme-fc: fix race between error recovery and creating association

 drivers/nvme/host/fc.c | 37 +++++++++++++++++++++++++++++--------
 1 file changed, 29 insertions(+), 8 deletions(-)

-- 
2.34.1




More information about the Linux-nvme mailing list