]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: Fix logic in virFileSetCOW
authorJiri Denemark <jdenemar@redhat.com>
Wed, 5 Aug 2020 08:01:45 +0000 (10:01 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 5 Aug 2020 09:04:17 +0000 (11:04 +0200)
When COW is not explicitly requested to be disabled or enabled, the
function is supposed to do nothing on non-BTRFS file systems.

Fixes commit 7230bc95aa78379c9ee20cf59394c5fc4305b75b.

https://bugzilla.redhat.com/show_bug.cgi?id=1866157

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/util/virfile.c

index 6ada3a708c2824282b45ea27b101cf26a974a976..7f22884b07d6ce012bac451bcdf33b6f900ed29a 100644 (file)
@@ -4522,7 +4522,7 @@ virFileSetCOW(const char *path,
     }
 
     if (buf.f_type != BTRFS_SUPER_MAGIC) {
-        if (state == VIR_TRISTATE_BOOL_ABSENT) {
+        if (state != VIR_TRISTATE_BOOL_ABSENT) {
             virReportSystemError(ENOSYS,
                                  _("unable to control COW flag on '%s', not btrfs"),
                                  path);