]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- handle case when qgroup cannot be destroy
authorArvin Schnell <aschnell@suse.de>
Wed, 6 Apr 2016 13:25:07 +0000 (15:25 +0200)
committerArvin Schnell <aschnell@suse.de>
Wed, 6 Apr 2016 13:25:07 +0000 (15:25 +0200)
snapper/Btrfs.cc

index 52291604bba8df6fb735dedba9e0748e5845be5a..8414b723c9c108a95d1b28b83485b7ff0c62ab3d 100644 (file)
@@ -381,14 +381,24 @@ namespace snapper
 
 #ifdef HAVE_LIBBTRFS
            deleted_subvolids.push_back(subvolid);
+#endif
 
 #ifdef ENABLE_BTRFS_QUOTA
-           // see https://bugzilla.suse.com/show_bug.cgi?id=972511
-           SDir subvolume_dir = openSubvolumeDir();
-           if (qgroup != no_qgroup)
-               qgroup_remove(subvolume_dir.fd(), calc_qgroup(0, subvolid), qgroup);
-           qgroup_destroy(subvolume_dir.fd(), calc_qgroup(0, subvolid));
-#endif
+
+           // workaround for the kernel not deleting the qgroup of a
+           // subvolume when deleting the subvolume, see
+           // https://bugzilla.suse.com/show_bug.cgi?id=972511
+
+           try
+           {
+               SDir subvolume_dir = openSubvolumeDir();
+               qgroup_destroy(subvolume_dir.fd(), calc_qgroup(0, subvolid));
+           }
+           catch (const runtime_error& e)
+           {
+               // Ignore that the qgroup could not be destroyed. Should not
+               // cause problems except of having unused qgroups.
+           }
 
 #endif
        }