]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- tiny improvements 1120/head
authorArvin Schnell <aschnell@suse.de>
Wed, 25 Mar 2026 08:34:02 +0000 (09:34 +0100)
committerArvin Schnell <aschnell@suse.de>
Wed, 25 Mar 2026 08:34:02 +0000 (09:34 +0100)
snapper/Filesystem.h
snapper/Snapper.cc

index 3b14df0610a3e0c4d001ddd4868114072f9cb3ac..c37da03fbbe8d8f846aace36a02bddba1724feb5 100644 (file)
@@ -66,9 +66,16 @@ namespace snapper
 
        virtual string snapshotDir(unsigned int num) const = 0;
 
+       // e.g. /test
        virtual SDir openSubvolumeDir() const;
+
+       // e.g. /test/.snapshots
        virtual SDir openInfosDir() const = 0;
+
+       // e.g. /test/.snapshots/42
        virtual SDir openInfoDir(unsigned int num) const;
+
+       // e.g. /test/.snapshots/42/snapshot
        virtual SDir openSnapshotDir(unsigned int num) const = 0;
 
        virtual void createSnapshot(unsigned int num, unsigned int num_parent, bool read_only,
index d1789e357ea290e0f31d455d9c5c1e72c0ad37a5..66ae6dcea4445762cb7dd9329c152e859f90ad77 100644 (file)
@@ -470,10 +470,15 @@ namespace snapper
        // Since we want all-time unique snapshot numbers there might be empty
        // directories.
 
-       SDir infos_dir = snapper->openInfosDir();
+       {
+           SDir infos_dir = snapper->openInfosDir();
+
+           for (const string& tmp : infos_dir.entries(SDir::number_entries))
+               infos_dir.rmdir(tmp);
 
-       for (const string& tmp : infos_dir.entries(SDir::number_entries))
-           infos_dir.rmdir(tmp);
+           // call ~SDir - although rmdir below (deleteConfig in LVM case) works on a
+           // busy directory - better save than sorry
+       }
 
        try
        {