Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Refactor and fix about NVMe status code
@ 2024-05-29 12:22 Weiwen Hu
  2024-05-29 12:22 ` [PATCH 1/3] nvme: fix nvme_pr_* status code parsing Weiwen Hu
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Weiwen Hu @ 2024-05-29 12:22 UTC (permalink / raw)
  To: linux-nvme; +Cc: Mike Christie, Christoph Hellwig, Weiwen Hu

We discovered that the PR ioctl status code is not correct for cloud disks
in Alibaba Cloud.  It turns out that we have MORE bit set in the status,
but nvme_sc_to_pr_err() forgot to mask it.

Besides fixing this (PATCH 1), I also (PATCH 2 and 3):
- replaced many magic numbers;
- replaced NVME_SC_(DNR|MORE|CRD) => NVME_STATUS_$1 .
These should clarify the code and make it easier to read, thus reducing the
chance of introducing bugs like this one in the future. The patches should
not affect the behavior of the code, and are independent to the fix.

Weiwen Hu (3):
  nvme: fix nvme_pr_* status code parsing
  nvme: fix status magic numbers
  nvme: rename CDR/MORE/DNR to NVME_STATUS_*

 drivers/nvme/host/constants.c          |  2 +-
 drivers/nvme/host/core.c               | 40 +++++++++++-----------
 drivers/nvme/host/fabrics.c            | 10 +++---
 drivers/nvme/host/fault_inject.c       |  2 +-
 drivers/nvme/host/fc.c                 |  6 ++--
 drivers/nvme/host/multipath.c          |  2 +-
 drivers/nvme/host/nvme.h               |  6 ++--
 drivers/nvme/host/pr.c                 | 10 +++---
 drivers/nvme/target/admin-cmd.c        | 24 +++++++-------
 drivers/nvme/target/core.c             | 46 +++++++++++++-------------
 drivers/nvme/target/discovery.c        | 14 ++++----
 drivers/nvme/target/fabrics-cmd-auth.c | 16 ++++-----
 drivers/nvme/target/fabrics-cmd.c      | 36 ++++++++++----------
 drivers/nvme/target/io-cmd-bdev.c      | 12 +++----
 drivers/nvme/target/passthru.c         | 10 +++---
 drivers/nvme/target/rdma.c             | 10 +++---
 drivers/nvme/target/tcp.c              |  4 +--
 drivers/nvme/target/zns.c              | 30 ++++++++---------
 include/linux/nvme.h                   | 16 +++++++--
 19 files changed, 153 insertions(+), 143 deletions(-)

-- 
2.45.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-05-30  6:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-29 12:22 [PATCH 0/3] Refactor and fix about NVMe status code Weiwen Hu
2024-05-29 12:22 ` [PATCH 1/3] nvme: fix nvme_pr_* status code parsing Weiwen Hu
2024-05-29 19:18   ` Chaitanya Kulkarni
2024-05-29 21:41     ` Keith Busch
2024-05-30  6:34       ` Weiwen Hu
2024-05-29 12:22 ` [PATCH 2/3] nvme: fix status magic numbers Weiwen Hu
2024-05-29 12:23 ` [PATCH 3/3] nvme: rename CDR/MORE/DNR to NVME_STATUS_* Weiwen Hu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox