[SPDK] "Open file failed: No such file or directory" error in examples/nvme/nvme_manage/nvme_manage tool

Isaac Otsiabah IOtsiabah at us.fujitsu.com
Wed May 24 17:23:23 PDT 2017


Ok, I will. Thank you.

Isaac

From: SPDK [mailto:spdk-bounces at lists.01.org] On Behalf Of Chang, Cunyin
Sent: Wednesday, May 24, 2017 5:21 PM
To: Storage Performance Development Kit <spdk at lists.01.org>
Subject: Re: [SPDK] "Open file failed: No such file or directory" error in examples/nvme/nvme_manage/nvme_manage tool

Hi Isaac,

Thanks very much for this debug, it looks like just as you mentioned and we need fix this, Do you want to submit a patch to fix this
or just let us to fix this?

Thanks,
Cunyin

From: SPDK [mailto:spdk-bounces at lists.01.org] On Behalf Of Isaac Otsiabah
Sent: Thursday, May 25, 2017 3:19 AM
To: spdk at lists.01.org<mailto:spdk at lists.01.org>
Subject: [SPDK] "Open file failed: No such file or directory" error in examples/nvme/nvme_manage/nvme_manage tool

I experimented with examples/nvme/nvme_manage/nvme_manage tool. After the prompt to enter the firmware path name, I entered the firmware full path name and got "Open file failed: No such file or directory" error.

After a little debug I found in update_firmware_image(void) function line 775, fgets(..) reads the new line character and puts it at the end of the input buffer. This new line character must be removed from the input buffer before the buffer contents is used.

775         if (fgets(path, 256, stdin) == NULL) {
776                 printf("Invalid path setting\n");
777                 while (getchar() != '\n');
778                 return;
779         }

The same problem is also in the get_controller() function after fgets is used to read the PCI Address from standard input.
300         while ((ch = getchar()) != '\n' && ch != EOF);
301         p = fgets(address, 64, stdin);
302         if (p == NULL) {
303                 return NULL;
304         }

Both can  be fixed by removing the new line character from the input buffer after fgets return
Ie.
if (path[strlen(path)-1]=='\n')
                path[strlen(path)-1]='\0';

Isaac
[root at spdk2 spdk]# ./examples/nvme/nvme_manage/nvme_manage
Starting DPDK 17.02.0 initialization...
[ DPDK EAL parameters: nvme_manage -c 0x1 --file-prefix=spdk_pid19289 ]
EAL: Detected 16 lcore(s)
EAL: No free hugepages reported in hugepages-1048576kB
EAL: Probing VFIO support...
EAL: PCI device 0000:02:00.0 on NUMA socket 0
EAL:   probe driver: 8086:953 spdk_nvme
EAL: PCI device 0000:03:00.0 on NUMA socket 0
EAL:   probe driver: 8086:953 spdk_nvme
EAL: PCI device 0000:04:00.0 on NUMA socket 0
EAL:   probe driver: 8086:953 spdk_nvme
EAL: PCI device 0000:05:00.0 on NUMA socket 0
EAL:   probe driver: 8086:953 spdk_nvme
IDENTIFY (06) sqid:0 cid:59 nsid:ffffffff cdw10:00000000 cdw11:00000000
INVALID NAMESPACE OR FORMAT (00/0b) sqid:0 cid:59 cdw0:0 sqhd:000a p:1 m:0 dnr:0
IDENTIFY (06) sqid:0 cid:59 nsid:ffffffff cdw10:00000000 cdw11:00000000
INVALID NAMESPACE OR FORMAT (00/0b) sqid:0 cid:59 cdw0:0 sqhd:000a p:1 m:0 dnr:0
IDENTIFY (06) sqid:0 cid:59 nsid:ffffffff cdw10:00000000 cdw11:00000000
INVALID NAMESPACE OR FORMAT (00/0b) sqid:0 cid:59 cdw0:0 sqhd:000a p:1 m:0 dnr:0
IDENTIFY (06) sqid:0 cid:59 nsid:ffffffff cdw10:00000000 cdw11:00000000
INVALID NAMESPACE OR FORMAT (00/0b) sqid:0 cid:59 cdw0:0 sqhd:000a p:1 m:0 dnr:0
NVMe Management Options
        [1: list controllers]
        [2: create namespace]
        [3: delete namespace]
        [4: attach namespace to controller]
        [5: detach namespace from controller]
        [6: format namespace or controller]
        [7: firmware update]
        [8: quit]
7
0000:02:00.00 INTEL SSDPEDMD800G4                      CVFT4216000E800CGN       0
0000:03:00.00 INTEL SSDPEDMD800G4                      CVFT4216000G800CGN       0
0000:04:00.00 INTEL SSDPEDMD800G4                      CVFT421500DG800CGN       0
0000:05:00.00 INTEL SSDPEDMD800G4                      CVFT421500DE800CGN       0
Please Input PCI Address(domain:bus:dev.func):
0000:05:00.00
Please Input The Path Of Firmware Image
/root/spdk/image/8DV101B0_8B1B0133_signed.bin
Open file failed: No such file or directory

press Enter to display cmd menu ...



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.01.org/pipermail/spdk/attachments/20170524/e548b13c/attachment.html>


More information about the SPDK mailing list