Skip to content

nvme controller reset and namespace scan work race conditions

Sagi Grimberg linux-nvme 10 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v10 Latest7 patches 3 repliesIn review
  2. v6 posting 2/20 of 7 patches 0 repliesSuperseded
  3. v6 posting 1/27 patches 0 repliesSuperseded
Earlier versions · 7
VersionPostedPatchesRepliesStatus
v57 patches0 repliesSuperseded
v3 posting 2/20 of 7 patches0 repliesSuperseded
v47 patches0 repliesSuperseded
v3 posting 1/27 patches0 repliesSuperseded
v2 RFC posting 2/20 of 6 patches0 repliesSuperseded
v2 RFC posting 1/26 patches0 repliesSuperseded
v1 RFC2 patches0 repliesSuperseded

Changes in v10 from the cover letter

- fixed positive nvme status leak to the block layer (and also for the allocation path, just to be consistent)
- instead of checking revalidate_disk ret code, ignore transient errors (non-dnr) in nvme_revalidate_disk (suggested by Christoph)
- changed the ordering of the patches a bit
- collected some more review tags

Patches in v10 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7nvme: fail cancelled commands with NVME_SC_HOST_PATH_ERRORdrivers/nvme/host/core.c+3 -10 replies
2/7nvme-tcp: fail command with NVME_SC_HOST_PATH_ERROR send faileddrivers/nvme/host/tcp.c+1 -10 replies
3/7nvme-fc: Fail transport errors with NVME_SC_HOST_PATHdrivers/nvme/host/fc.c+30 -70 replies
4/7nvme: pass status to nvme_error_statusdrivers/nvme/host/core.c+3 -31 reply
5/7nvme: make nvme_identify_ns propagate errors backdrivers/nvme/host/core.c+20 -191 reply
6/7nvme: make nvme_report_ns_ids propagate error backdrivers/nvme/host/core.c+22 -60 replies
7/7nvme: fix ns removal hang when failing to revalidate due to a transient errordrivers/nvme/host/core.c+7 -11 reply

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchMinwoo ImHannes ReineckeJames SmartChristoph HellwigChaitanya Kulkarni
1/7R-b R-b R-b R-b
2/7R-b R-b R-b R-b
3/7R-b R-b R-b
4/7R-b
5/7R-b R-b R-b R-b R-b
6/7R-b R-b R-b R-b
7/7R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v10 thread

Cover letter [PATCH v10 0/7] nvme controller reset and namespace scan work race conditions

Hey all,

This series handles the reset and scanning race saga.

The approach is to have the relevant admin commands return a proper status code that reflects that we had a transport error and not remove the namepsace if that is indeed the case.

This should be a reliable way to know if the revalidate_disk failed due to a transport error or not.

I am able to reproduce this race with the following command (using
tcp/rdma):
for j in seq 50; do nvme connect-all; for i in seq 50; do nvme reset /dev/nvme0; done ; nvme disconnect-all; done

With this patch set I was able to pass the test without reproducing the hang that hannes reported.

This version follows Christoph's suggestion to ignore non dnr failures in nvme_revalidate_disk

Changes from v9:
- fixed positive nvme status leak to the block layer (and also for the allocation path, just to be consistent)
- instead of checking revalidate_disk ret code, ignore transient errors (non-dnr) in nvme_revalidate_disk (suggested by Christoph)
- changed the ordering of the patches a bit
- collected some more review tags

Changes from v8:
- fixed nvme_revalidate_disk to never leak nvme status to the block layer
- used __nvme_revalidate_disk in nvme_validate_ns to also check for nvme status if return status is positive
- added patch to rename __nvme_revalidate_disk to nvme_revalidate_ns
- added patch that makes nvme_status_error get status instead of request struct
- added review tags

Changes from v7:
- added patch to split out revalidate_disk to ->revalidate_disk() and check_disk_size
- split nvme_validate_ns to call nvme_revalidate_disk and the new check_disk_size callout (only if nvme_revalidate_disk succeeded)

Changes from v6:
- dropped patch for nvme_submit_sync_cmd returning blk_status_t, it is now returning nvme status or negative errno again
- made nvme_identify_ns return status code and get id struct by reference
- made nvme_validate_ns check for -ENOMEM or NVME_SC_HOST_PATH_ERROR to decide if it should/should'nt to remove the namespace.
- added review tags

Changes from v5:
- don't return blk_status_t from nvme_submit_user_cmd

Changes from v4:
- return nvme_error_status in __nvme_submit_sync_cmd and cast to errno in nvme_identify_ns
- modified status print in nvme_report_ns_ids

Changes from v3:
- return blk_status_to_errno instead of blk_status_t in sync cmds
- check for normal return errno from revalidate_disk, this covers transport errors, but also spurious allocation errors and any type of transient errors.

Changes from v2:
- added fc patch from James (can you test please?)
- made nvme_identify_ns return id or PTR_ERR (Hannes)

Changes from v1:
- different approach

James Smart (1):
nvme-fc: Fail transport errors with NVME_SC_HOST_PATH

Sagi Grimberg (6):
nvme: fail cancelled commands with NVME_SC_HOST_PATH_ERROR
nvme-tcp: fail command with NVME_SC_HOST_PATH_ERROR send failed
nvme: pass status to nvme_error_status
nvme: make nvme_identify_ns propagate errors back
nvme: make nvme_report_ns_ids propagate error back
nvme: fix ns removal hang when failing to revalidate due to a
transient error

 drivers/nvme/host/core.c | 83 ++++++++++++++++++++++++++--------------
 drivers/nvme/host/fc.c   | 37 ++++++++++++++----
 drivers/nvme/host/tcp.c  |  2 +-
 3 files changed, 85 insertions(+), 37 deletions(-)
Signature · 7 lines
2.17.1


_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme