The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/6948

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From 7c824cfed876dc94483edf841dd03e3656b65a21 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Thu, 27 Feb 2020 08:31:07 -0500
Subject: [PATCH] lxd/storage/zfs: Skip volmode on 0.6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 lxd/storage/drivers/driver_zfs.go         | 6 +++++-
 lxd/storage/drivers/driver_zfs_patches.go | 5 +++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/lxd/storage/drivers/driver_zfs.go 
b/lxd/storage/drivers/driver_zfs.go
index d4c584afe5..0667aa7909 100644
--- a/lxd/storage/drivers/driver_zfs.go
+++ b/lxd/storage/drivers/driver_zfs.go
@@ -245,7 +245,11 @@ func (d *zfs) Create() error {
 
                properties := []string{"mountpoint=none"}
                if shared.StringInSlice(dataset, []string{"virtual-machines", 
"deleted/virtual-machines"}) {
-                       properties = append(properties, "volmode=none")
+                       if len(zfsVersion) >= 3 && zfsVersion[0:3] == "0.6" {
+                               d.logger.Warn("Unable to set volmode on parent 
virtual-machines datasets due to ZFS being too old")
+                       } else {
+                               properties = append(properties, "volmode=none")
+                       }
                }
 
                err := d.createDataset(filepath.Join(d.config["zfs.pool_name"], 
dataset), properties...)
diff --git a/lxd/storage/drivers/driver_zfs_patches.go 
b/lxd/storage/drivers/driver_zfs_patches.go
index ae147a7834..abf8d09879 100644
--- a/lxd/storage/drivers/driver_zfs_patches.go
+++ b/lxd/storage/drivers/driver_zfs_patches.go
@@ -88,6 +88,11 @@ func (d *zfs) patchStorageZFSMount() error {
 }
 
 func (d *zfs) patchStorageZFSVolMode() error {
+       if len(zfsVersion) >= 3 && zfsVersion[0:3] == "0.6" {
+               d.logger.Warn("Unable to set volmode on parent virtual-machines 
datasets due to ZFS being too old")
+               return nil
+       }
+
        // Set volmode=none on the parent virtual-machines directory
        err := d.setDatasetProperties(filepath.Join(d.config["zfs.pool_name"], 
"virtual-machines"), "volmode=none")
        if err != nil {
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to