From 0dd4788a84de4ceb2a246c1ee7bc7e2242e61f8a Mon Sep 17 00:00:00 2001 From: Jeff Cook Date: Sun, 9 May 2021 05:29:05 -0600 Subject: [PATCH] Reflow ZFS check to follow the style of the overlayfs return. Per https://github.com/lxc/lxc/pull/3831#discussion_r628865713 Signed-off-by: Jeff Cook --- src/lxc/conf.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/lxc/conf.c b/src/lxc/conf.c index dd5b04388..123591cf8 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -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 { -- 2.47.2