[lxc-devel] [lxd/master] zfs: Use tryMount when mounting filesystem

stgraber on Github lxc-bot at linuxcontainers.org
Mon Jul 10 21:40:04 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 390 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170710/be756b98/attachment.bin>
-------------- next part --------------
From 9d3e6c57e0374cd712723d23d890f84b81669b2c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 10 Jul 2017 17:39:24 -0400
Subject: [PATCH] zfs: Use tryMount when mounting filesystem
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

May help with some of the EBUSY.

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/storage_zfs.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxd/storage_zfs.go b/lxd/storage_zfs.go
index 396c5d45f..bbdd2dd54 100644
--- a/lxd/storage_zfs.go
+++ b/lxd/storage_zfs.go
@@ -454,7 +454,7 @@ func (s *storageZfs) ContainerMount(c container) (bool, error) {
 	if !shared.IsMountPoint(containerPoolVolumeMntPoint) {
 		source := fmt.Sprintf("%s/%s", s.getOnDiskPoolName(), fs)
 		zfsMountOptions := fmt.Sprintf("rw,zfsutil,mntpoint=%s", containerPoolVolumeMntPoint)
-		mounterr := syscall.Mount(source, containerPoolVolumeMntPoint, "zfs", 0, zfsMountOptions)
+		mounterr := tryMount(source, containerPoolVolumeMntPoint, "zfs", 0, zfsMountOptions)
 		if mounterr != nil {
 			if mounterr != syscall.EBUSY {
 				logger.Errorf("Failed to mount ZFS dataset \"%s\" onto \"%s\".", source, containerPoolVolumeMntPoint)


More information about the lxc-devel mailing list