Skip to contentSkip to conversation

nvmetcli: don't remove ANA Group 1 on clear

PATCH Applied Hannes Reinecke 2 participants 2 messages Mar 27, 2020 – Apr 1, 2020 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvmetcli: don't remove ANA Group 1 on clear

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

---
 nvmet/nvme.py | 5 +++++
 1 file changed, 5 insertions(+)
nvmet/nvme.py +5 -0
index 0647ddc..fdec4ff 100644
@@ -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
Signature · 7 lines
2.16.4


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