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

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) ===
Closes #3657

Signed-off-by: Stéphane Graber <[email protected]>
From 4d6ad5664cf33990e6c78966d2f0a7c1b617f047 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <[email protected]>
Date: Mon, 14 Aug 2017 15:27:09 -0400
Subject: [PATCH] zfs: Always require existing datasets to be empty
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #3657

Signed-off-by: Stéphane Graber <[email protected]>
---
 lxd/storage_zfs.go | 24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/lxd/storage_zfs.go b/lxd/storage_zfs.go
index 04761ec7c..bc590a2e7 100644
--- a/lxd/storage_zfs.go
+++ b/lxd/storage_zfs.go
@@ -207,29 +207,25 @@ func (s *storageZfs) zfsPoolCreate() error {
                                        if err := zfsPoolCreate("", vdev); err 
!= nil {
                                                return err
                                        }
-                               } else {
-                                       if err := zfsPoolVolumeSet(vdev, "", 
"mountpoint", "none"); err != nil {
-                                               return err
-                                       }
                                }
                        } else {
                                err := zfsPoolCheck(vdev)
                                if err != nil {
                                        return err
                                }
+                       }
 
-                               subvols, err := 
zfsPoolListSubvolumes(zpoolName, vdev)
-                               if err != nil {
-                                       return err
-                               }
+                       subvols, err := zfsPoolListSubvolumes(zpoolName, vdev)
+                       if err != nil {
+                               return err
+                       }
 
-                               if len(subvols) > 0 {
-                                       return fmt.Errorf("Provided ZFS pool 
(or dataset) isn't empty")
-                               }
+                       if len(subvols) > 0 {
+                               return fmt.Errorf("Provided ZFS pool (or 
dataset) isn't empty")
+                       }
 
-                               if err := zfsPoolVolumeSet(vdev, "", 
"mountpoint", "none"); err != nil {
-                                       return err
-                               }
+                       if err := zfsPoolVolumeSet(vdev, "", "mountpoint", 
"none"); err != nil {
+                               return err
                        }
                }
        }
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to