[lxc-devel] [lxd/master] dir: create symlink on freeze failure

brauner on Github lxc-bot at linuxcontainers.org
Mon Jun 5 23:25:49 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 364 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170605/01225c4d/attachment.bin>
-------------- next part --------------
From da0a812a7daeeafde1ccac16a6d86d3da4d1aab4 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Tue, 6 Jun 2017 01:24:42 +0200
Subject: [PATCH] dir: create symlink on freeze failure

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 lxd/storage_dir.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lxd/storage_dir.go b/lxd/storage_dir.go
index c8132a115..691390b41 100644
--- a/lxd/storage_dir.go
+++ b/lxd/storage_dir.go
@@ -607,7 +607,7 @@ func (s *storageDir) ContainerSnapshotCreate(snapshotContainer container, source
 		err := sourceContainer.Freeze()
 		if err != nil {
 			logger.Errorf("Trying to freeze and rsync again failed.")
-			return nil
+			goto onSuccess
 		}
 
 		err = rsync(snapshotContainer, sourceContainerMntPoint, targetContainerMntPoint, bwlimit)
@@ -618,6 +618,7 @@ func (s *storageDir) ContainerSnapshotCreate(snapshotContainer container, source
 		defer sourceContainer.Unfreeze()
 	}
 
+onSuccess:
 	// Check if the symlink
 	// ${LXD_DIR}/snapshots/<source_container_name> -> ${POOL_PATH}/snapshots/<source_container_name>
 	// exists and if not create it.


More information about the lxc-devel mailing list