[PATCH 14/24] Clean up deleted backstores properly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Cleaning up backstores instead of storage objects ensures that configfs
doesn't get cluttered with no-so backstores.

Signed-off-by: Andy Grover <agrover@xxxxxxxxxx>
---
 rtslib/root.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/rtslib/root.py b/rtslib/root.py
index b055c24..9c43834 100644
--- a/rtslib/root.py
+++ b/rtslib/root.py
@@ -166,11 +166,12 @@ class RTSRoot(CFSNode):
         if not confirm:
             raise RTSLibError("As a precaution, confirm=True needs to be set")
 
-        # targets depend on storage objects, delete them first
+        # Targets depend on storage objects, delete them first.
+        # Deleting backstores deletes associated storageobjects.
         for t in self.targets:
             t.delete()
-        for so in self.storage_objects:
-            so.delete()
+        for bs in self.backstores:
+            bs.delete()
 
     def restore(self, config, clear_existing=False):
         '''
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux