]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- fix use of does_subvolume_exist() 779/head
authorArvin Schnell <aschnell@suse.de>
Mon, 6 Feb 2023 09:44:53 +0000 (10:44 +0100)
committerArvin Schnell <aschnell@suse.de>
Mon, 6 Feb 2023 09:44:53 +0000 (10:44 +0100)
LIBVERSION
package/snapper.changes
snapper/Btrfs.cc
snapper/BtrfsUtils.cc
testsuite-real/test-btrfsutils.cc

index 6abaeb2f90723ba328101fc117a1f19e93407e47..024b066c0bb7a9d14bef70694e6c6b54917ed3d5 100644 (file)
@@ -1 +1 @@
-6.2.0
+6.2.1
index f8abf68af22f910436093e8120f4a8f51c8d3e58..de5b813478b5a94787d4e71db5d907a0ddadb94f 100644 (file)
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+Mon Feb 06 10:43:33 CET 2023 - aschnell@suse.com
+
+- fix use of does_subvolume_exist() (bsc#1207901)
+
 -------------------------------------------------------------------
 Wed Jan 25 12:25:23 CET 2023 - aschnell@suse.com
 
index d7af15aee68ee8334386919a2f4a17583c8d517a..80f45d0f51da91d2d70ea2fc4cc9ab3a0b2e90ad 100644 (file)
@@ -1577,7 +1577,7 @@ namespace snapper
 #ifdef HAVE_LIBBTRFS
            for (subvolid_t subvolid : deleted_subvolids)
            {
-               while (!does_subvolume_exist(subvolume_dir.fd(), subvolid))
+               while (does_subvolume_exist(subvolume_dir.fd(), subvolid))
                    sleep(1);
            }
 #endif
index 6d693533c220e79e341b6d420d183fb5af9df316..53bcb92a8a5c393de14ef61160cd9261d689082d 100644 (file)
@@ -387,7 +387,7 @@ namespace snapper
            if (ioctl(fd, BTRFS_IOC_TREE_SEARCH, &args) < 0)
                throw runtime_error_with_errno("ioctl(BTRFS_IOC_TREE_SEARCH) failed", errno);
 
-           return sk->nr_items == 0;
+           return sk->nr_items > 0;
 #endif
        }
 
index 94ddae80065d289d7b9865e6aa066208c8373924..1134e0c5d0965333312ed79af18f01b4f6d29fe3 100644 (file)
@@ -35,6 +35,12 @@ main()
     }
 
 
+    if (false)
+    {
+       cout << does_subvolume_exist(fd, 280) << '\n';
+    }
+
+
     if (false)
     {
        quota_enable(fd);