[lxc-devel] [lxd/master] lxd/storage/zfs: Properly wrap mount error

stgraber on Github lxc-bot at linuxcontainers.org
Fri Aug 9 15:14:48 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 370 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190809/dd35f15e/attachment.bin>
-------------- next part --------------
From ab713a98b199704c9a842810c9b1775d3be2fb35 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Fri, 9 Aug 2019 11:13:30 -0400
Subject: [PATCH] lxd/storage/zfs: Properly wrap mount error
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #6057

Signed-off-by: St├ęphane Graber <stgraber at ubuntu.com>
---
 lxd/storage_zfs_utils.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lxd/storage_zfs_utils.go b/lxd/storage_zfs_utils.go
index 5022651865..fb9b410495 100644
--- a/lxd/storage_zfs_utils.go
+++ b/lxd/storage_zfs_utils.go
@@ -9,6 +9,7 @@ import (
 	"strings"
 	"time"
 
+	"github.com/pkg/errors"
 	"github.com/pborman/uuid"
 	"golang.org/x/sys/unix"
 
@@ -685,7 +686,7 @@ func (s *storageZfs) doContainerMount(projectName, name string, privileged bool)
 		if mounterr != nil {
 			if mounterr != unix.EBUSY {
 				logger.Errorf("Failed to mount ZFS dataset \"%s\" onto \"%s\": %v", source, containerPoolVolumeMntPoint, mounterr)
-				return false, mounterr
+				return false, errors.Wrapf(mounterr, "Failed to mount ZFS dataset \"%s\" onto \"%s\"", source, containerPoolVolumeMntPoint)
 			}
 			// EBUSY error in zfs are related to a bug we're
 			// tracking. So ignore them for now, report back that


More information about the lxc-devel mailing list