linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvmetcli: don't remove ANA Group 1 on clear
@ 2020-03-27  7:01 Hannes Reinecke
  2020-04-01  9:04 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Hannes Reinecke @ 2020-03-27  7:01 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-nvme, Sagi Grimberg, Keith Busch, Hannes Reinecke

The first ANA group is maintained by the kernel so it cannot
be deleted.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 nvmet/nvme.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/nvmet/nvme.py b/nvmet/nvme.py
index 0647ddc..fdec4ff 100644
--- a/nvmet/nvme.py
+++ b/nvmet/nvme.py
@@ -845,6 +845,11 @@ class ANAGroup(CFSNode):
 
         a._setup_attrs(n, err_func)
 
+    def delete(self):
+        # ANA Group 1 is automatically created/deleted
+        if self.grpid != 1:
+            super(ANAGroup, self).delete()
+
     def dump(self):
         d = super(ANAGroup, self).dump()
         d['grpid'] = self.grpid
-- 
2.16.4


_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-01  9:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-27  7:01 [PATCH] nvmetcli: don't remove ANA Group 1 on clear Hannes Reinecke
2020-04-01  9:04 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).