Skip to contentSkip to conversation

nvmetcli: Unable to run clear/restore

DISCUSSION Tony Asleson 2 participants 3 messages Mar 20, 2020 – Mar 26, 2020 NVMe

lore
Share & tools
lore
#0 lore raw

While experimenting with nvmetcli I'm unable to run clear or restore.

Using master branch against Fedora 31, 5.5.9-200.fc31.x86_64

# ./nvmetcli clear
Traceback (most recent call last):
  File "./nvmetcli", line 740, in <module>
    main()
  File "./nvmetcli", line 722, in main
    funcs[sys.argv[1]](savefile)
  File "./nvmetcli", line 689, in clear
    nvme.Root().clear_existing()
  File "/root/projects/nvmetcli/nvmet/nvme.py", line 315, in clear_existing
    p.delete()
  File "/root/projects/nvmetcli/nvmet/nvme.py", line 677, in delete
    a.delete()
  File "/root/projects/nvmetcli/nvmet/nvme.py", line 200, in delete
    os.rmdir(self.path)
PermissionError: [Errno 1] Operation not permitted:
'/sys/kernel/config/nvmet/ports/0/ana_groups/1'
# ./nvmetcli restore
No saved config file at None, ok, exiting

I just posted a patch series, with those changes when I repeat the restore I get

# ./nvmetcli restore
Error processing config file at None, error [Errno 1] Operation not
permitted: '/sys/kernel/config/nvmet/ports/0/ana_groups/1', exiting

Same error when trying to run make test eg.

[Errno 1] Operation not permitted:
'/sys/kernel/config/nvmet/ports/0/ana_groups/1'

Do I have a mismatch between kernel and user space here or am I missing something?

Thanks!
-Tony

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

#1 lore raw
Quoted 4 lines · Tony Asleson

While experimenting with nvmetcli I'm unable to run clear or restore.

Using master branch against Fedora 31, 5.5.9-200.fc31.x86_64

Quoted 16 lines
# ./nvmetcli clear
Traceback (most recent call last):
  File "./nvmetcli", line 740, in <module>
    main()
  File "./nvmetcli", line 722, in main
    funcs[sys.argv[1]](savefile)
  File "./nvmetcli", line 689, in clear
    nvme.Root().clear_existing()
  File "/root/projects/nvmetcli/nvmet/nvme.py", line 315, in clear_existing
    p.delete()
  File "/root/projects/nvmetcli/nvmet/nvme.py", line 677, in delete
    a.delete()
  File "/root/projects/nvmetcli/nvmet/nvme.py", line 200, in delete
    os.rmdir(self.path)
PermissionError: [Errno 1] Operation not permitted:
'/sys/kernel/config/nvmet/ports/0/ana_groups/1'

Apparently if I simply do

# rmdir /sys/kernel/config/nvmet/ports/1

The port and associated ana group gets removed and the usage count for the kernel module nvmet goes to zero.

Is the bug that we are trying to remove /sys/kernel/config/nvmet/ports/0/ana_groups/1 in userspace from nvmetcli which can simply be corrected with

nvmet/nvme.py +0 -2
index 089bafb..a2565e4 100644
@@ -686,8 +686,6 @@ class Port(CFSNode):
         self._check_self()
         for s in self.subsystems:
             self.remove_subsystem(s)
-        for a in self.ana_groups:
-            a.delete()
 
 

or that we should be able to remove it and can't, thus the issue is in the kernel?

Thanks,
Tony

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

maintainer
#2 lore raw
Quoted 44 lines
Quoted 4 lines

While experimenting with nvmetcli I'm unable to run clear or restore.

Using master branch against Fedora 31, 5.5.9-200.fc31.x86_64

Quoted 16 lines
# ./nvmetcli clear
Traceback (most recent call last):
   File "./nvmetcli", line 740, in <module>
     main()
   File "./nvmetcli", line 722, in main
     funcs[sys.argv[1]](savefile)
   File "./nvmetcli", line 689, in clear
     nvme.Root().clear_existing()
   File "/root/projects/nvmetcli/nvmet/nvme.py", line 315, in clear_existing
     p.delete()
   File "/root/projects/nvmetcli/nvmet/nvme.py", line 677, in delete
     a.delete()
   File "/root/projects/nvmetcli/nvmet/nvme.py", line 200, in delete
     os.rmdir(self.path)
PermissionError: [Errno 1] Operation not permitted:
'/sys/kernel/config/nvmet/ports/0/ana_groups/1'

Apparently if I simply do

# rmdir /sys/kernel/config/nvmet/ports/1

The port and associated ana group gets removed and the usage count for the kernel module nvmet goes to zero.

Is the bug that we are trying to remove /sys/kernel/config/nvmet/ports/0/ana_groups/1 in userspace from nvmetcli which can simply be corrected with

nvmet/nvme.py +0 -2
index 089bafb..a2565e4 100644
@@ -686,8 +686,6 @@ class Port(CFSNode):
          self._check_self()
          for s in self.subsystems:
              self.remove_subsystem(s)
-        for a in self.ana_groups:
-            a.delete()
 
 
Quoted 2 lines

or that we should be able to remove it and can't, thus the issue is in the kernel?

IIRC that this is an issue that Hannes was aiming to address?

Hannes?

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