Linux-NVME Archive on
 help / color / Atom feed
From: Tony Asleson <>
Subject: Re: nvmetcli: Unable to run clear/restore
Date: Thu, 26 Mar 2020 13:30:37 -0500
Message-ID: <> (raw)
In-Reply-To: <>

On 3/20/20 3:50 PM, Tony Asleson wrote:
> 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/", line 315, in clear_existing
>     p.delete()
>   File "/root/projects/nvmetcli/nvmet/", line 677, in delete
>     a.delete()
>   File "/root/projects/nvmetcli/nvmet/", 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

diff --git a/nvmet/ b/nvmet/
index 089bafb..a2565e4 100644
--- a/nvmet/
+++ b/nvmet/
@@ -686,8 +686,6 @@ class Port(CFSNode):
         for s in self.subsystems:
-        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?


linux-nvme mailing list

  reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-20 20:50 Tony Asleson
2020-03-26 18:30 ` Tony Asleson [this message]
2020-03-26 19:26   ` Sagi Grimberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-NVME Archive on

Archives are clonable:
	git clone --mirror linux-nvme/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nvme linux-nvme/ \
	public-inbox-index linux-nvme

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone