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

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 #7724

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From b2e39a9287495a2fb2e8961691b61e3badcf3fc5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Sat, 22 Aug 2020 19:04:19 -0400
Subject: [PATCH] lxd/storage/zfs: Always discard mountpoint on recv
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #7724

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 lxd/storage/drivers/driver_zfs_utils.go   | 4 ++--
 lxd/storage/drivers/driver_zfs_volumes.go | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lxd/storage/drivers/driver_zfs_utils.go 
b/lxd/storage/drivers/driver_zfs_utils.go
index 62619abf6d..bf67e58053 100644
--- a/lxd/storage/drivers/driver_zfs_utils.go
+++ b/lxd/storage/drivers/driver_zfs_utils.go
@@ -266,8 +266,8 @@ func (d *zfs) sendDataset(dataset string, parent string, 
volSrcArgs *migration.V
 }
 
 func (d *zfs) receiveDataset(dataset string, conn io.ReadWriteCloser, 
writeWrapper func(io.WriteCloser) io.WriteCloser) error {
-       // Assemble zfs send command.
-       cmd := exec.Command("zfs", "receive", "-F", "-u", dataset)
+       // Assemble zfs receive command.
+       cmd := exec.Command("zfs", "receive", "-x", "mountpoint", "-F", "-u", 
dataset)
 
        // Prepare stdin/stderr.
        stdin, err := cmd.StdinPipe()
diff --git a/lxd/storage/drivers/driver_zfs_volumes.go 
b/lxd/storage/drivers/driver_zfs_volumes.go
index 3edbc96456..c936189a64 100644
--- a/lxd/storage/drivers/driver_zfs_volumes.go
+++ b/lxd/storage/drivers/driver_zfs_volumes.go
@@ -307,7 +307,7 @@ func (d *zfs) CreateVolumeFromBackup(vol Volume, srcBackup 
backup.Info, srcData
 
                        if hdr.Name == srcFile {
                                // Extract the backup.
-                               err = shared.RunCommandWithFds(tr, nil, "zfs", 
"receive", "-F", target)
+                               err = shared.RunCommandWithFds(tr, nil, "zfs", 
"receive", "-x", "mountpoint", "-F", target)
 
                                if err != nil {
                                        return err
@@ -487,7 +487,7 @@ func (d *zfs) CreateVolumeFromCopy(vol Volume, srcVol 
Volume, copySnapshots bool
 
                // Send/receive the snapshot.
                var sender *exec.Cmd
-               receiver := exec.Command("zfs", "receive", d.dataset(vol, 
false))
+               receiver := exec.Command("zfs", "receive", "-x", "mountpoint", 
d.dataset(vol, false))
 
                // Handle transferring snapshots.
                if len(snapshots) > 0 {
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to