]> www.infradead.org Git - users/sagi/nvme-cli.git/commit
nvme-cli: don't try to disconnect for ctrl with pcie transport
authorMinwoo Im <minwoo.im.dev@gmail.com>
Thu, 16 May 2019 17:23:49 +0000 (10:23 -0700)
committerKeith Busch <keith.busch@intel.com>
Fri, 24 May 2019 14:44:23 +0000 (08:44 -0600)
commit3bfedd3be05c0a443ac93b36105be358de55caf3
tree33e6f09e35f3174f1fcd5e480ec072d999c5a12c
parent1e4b0d8149941a08eea312f74fbcbd570d7bc622
nvme-cli: don't try to disconnect for ctrl with pcie transport

If a host system has both pcie and fabrics controllers, the following
nvme-cli disconnect-all command will might not be working because
contrlller with pcie transport does not have delete_controller in sysfs.

root@target:~# nvme list
Node             SN                   Model                                    Namespace Usage                      Format           FW Rev
---------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------
/dev/nvme0n1     foo                  QEMU NVMe Ctrl                           1         536.87  MB / 536.87  MB    512   B +  0 B   1.0
/dev/nvme1n1     b92326b9b2323bf0     Linux                                    1         134.22  MB / 134.22  MB    512   B +  0 B   5.1.0-rc
/dev/nvme2n1     65fa04eddd9bbac0     Linux                                    1         134.22  MB / 134.22  MB    512   B +  0 B   5.1.0-rc

root@target:~/nvme-cli.git# nvme disconnect-all
Failed to open /sys/class/nvme/nvme0/delete_controller: No such file or directory

This patch checks the transport type of the controller in iteration.

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
fabrics.c