]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Reflow ZFS check to follow the style of the overlayfs return. 3831/head
authorJeff Cook <jeff@jeffcook.io>
Sun, 9 May 2021 11:29:05 +0000 (05:29 -0600)
committerJeff Cook <jeff@jeffcook.io>
Sun, 9 May 2021 11:40:17 +0000 (05:40 -0600)
Per https://github.com/lxc/lxc/pull/3831#discussion_r628865713

Signed-off-by: Jeff Cook <jeff@jeffcook.io>
src/lxc/conf.c

index dd5b043880be1e04edb90a584e06cb54692fdd78..123591cf8d3b0f6b38a35f29a8fb943cbe942cf7 100644 (file)
@@ -543,16 +543,13 @@ int lxc_rootfs_init(struct lxc_conf *conf, bool userns)
                        return syserror_set(-EINVAL, "Idmapped rootfs currently only supports the \"dir\" storage driver");
        }
 
-       if (rootfs->bdev_type && strequal(rootfs->bdev_type, "zfs")) {
-               TRACE("Not pinning because container uses ZFS");
-               goto out;
-       }
-
        if (rootfs->path) {
-               if (rootfs->bdev_type &&
-                   (strequal(rootfs->bdev_type, "overlay") ||
-                    strequal(rootfs->bdev_type, "overlayfs")))
-                       return log_trace_errno(0, EINVAL, "Not pinning on stacking filesystem");
+               if (rootfs->bdev_type) {
+                       if (strequal(rootfs->bdev_type, "overlay") || strequal(rootfs->bdev_type, "overlayfs"))
+                               return log_trace_errno(0, EINVAL, "Not pinning on stacking filesystem");
+                       if (strequal(rootfs->bdev_type, "zfs"))
+                               return log_trace_errno(0, EINVAL, "Not pinning on ZFS filesystem");
+               }
 
                dfd_path = open_at(-EBADF, rootfs->path, PROTECT_OPATH_FILE, 0, 0);
        } else {