Skip to content

nvme: flush rescan worker before resetting

Hannes Reinecke linux-nvme 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2nvme: Do not remove namespaces during resetdrivers/nvme/host/core.c+11 -02 replies
2/2nvme: flush scan_work when resetting controllerdrivers/nvme/host/core.c drivers/nvme/host/fc.c drivers/nvme/host/rdma.c +1 more+13 -04 replies
2/2nvme: flush scan_work when resetting controller+0 -02 replies
2/2nvme: flush scan_work when resetting controller+0 -01 reply
2/2nvme: flush scan_work when resetting controller+0 -03 replies
2/2nvme: flush scan_work when resetting controller+0 -00 replies
2/2nvme: flush scan_work when resetting controller+0 -02 replies
2/2nvme: flush scan_work when resetting controller+0 -01 reply
2/2nvme: flush scan_work when resetting controller+0 -02 replies
2/2nvme: flush scan_work when resetting controller+0 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] nvme: flush rescan worker before resetting

Hi all,

There is a race condition between namespace rescanning and controller reset; during controller reset all namespaces are quiesed vie nams_stop_ctrl(), and after reset all namespaces are unquiesced again.
When namespace scanning was active by the time controller reset was triggered the rescan code will call nvme_ns_remove(), which then will cause a kernel crash in nvme_start_ctrl() as it'll trip over uninitialized namespaces.

To fix this two patches are required; the first one will skip the call to nvme_ns_remove() if the controller is not live, and the second one will flush the rescan worker before resetting to avoid this situation from occurring.

As usual, comments and reviews are welcome.

Hannes Reinecke (2):
nvme: Do not remove namespaces during reset
nvme: flush scan_work when resetting controller

 drivers/nvme/host/core.c | 21 +++++++++++++++++++++
 drivers/nvme/host/fc.c   |  1 +
 drivers/nvme/host/rdma.c |  1 +
 drivers/nvme/host/tcp.c  |  1 +
 4 files changed, 24 insertions(+)
Signature · 1 line
2.16.4