[PATCH nvme-cli 0/2] add "State" field in command "nvme list"

chengjike chengjike.cheng at huawei.com
Wed Sep 15 06:29:10 PDT 2021


When NVMe Subsystem is connected with one or more controllers via fabric, such as NVMe-oF over RDMA,  
if some links are down, some nvme disks on the host are faulty and they won't be deleted immediately. 
But the "nvme list" command does not show these faulty disks. 
So add "State" field  in command "nvme list", and display the status of each disk for users.
For example:
[root at localhost nvme-cli]# nvme list 
Node        SN                   Model         Namespace Usage                    Format           FW Rev   Status       
----------- -------------------- ------------- --------- ------------------------ ---------------- -------- --------     
nvme0n2     25658552656655456265 Huawei-XSG1   2         2.83  GB /  10.74  GB    512   B +  0 B   1000001  live            
nvme0n1     25658552656655456265 Huawei-XSG1   1         2.78  GB /  10.74  GB    512   B +  0 B   1000001  faulty            
[root at localhost nvme-cli]# 

chengjike (1):
  add "State" entry

 nvme-print.c      | 15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

chengjike (1):
  set disk state

 src/nvme/private.h |  1 +
 src/nvme/tree.c    | 59 +++++++++++++++++++++++++++++++++++++++++-----
 src/nvme/tree.h    |  8 +++++++
 3 files changed, 62 insertions(+), 6 deletions(-)

-- 
2.21.0.windows.1




More information about the Linux-nvme mailing list