[lxc-devel] [lxc/master] bugfixes

brauner on Github lxc-bot at linuxcontainers.org
Thu Mar 29 16:38:05 UTC 2018


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/20180329/434de477/attachment.bin>
-------------- next part --------------
From 9104c79a1d71e28ae56cbc68f6cbadf42eca6f71 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Thu, 29 Mar 2018 18:20:35 +0200
Subject: [PATCH 1/2] tools: fix unitialized variable

Closes #2242.

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 src/lxc/tools/lxc_copy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lxc/tools/lxc_copy.c b/src/lxc/tools/lxc_copy.c
index b4e1178fd..08ef41fc8 100644
--- a/src/lxc/tools/lxc_copy.c
+++ b/src/lxc/tools/lxc_copy.c
@@ -745,7 +745,7 @@ static char *mount_tmpfs(const char *oldname, const char *newname,
 	int ret, fd;
 	size_t len;
 	char *premount = NULL;
-	FILE *fp;
+	FILE *fp = NULL;
 
 	if (arg->tmpfs && arg->keepdata) {
 		fprintf(stderr, "%s\n",
@@ -810,7 +810,7 @@ static char *mount_tmpfs(const char *oldname, const char *newname,
 err_close:
 	if (fd > 0)
 		close(fd);
-	else
+	else if (fp)
 		fclose(fp);
 err_free:
 	free(premount);

From 16c92537a5b481f4dbea7b1fee840c3011a99805 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Thu, 29 Mar 2018 18:29:49 +0200
Subject: [PATCH 2/2] storage: fix lvm fs uuid generation

Closes #2241.

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 src/lxc/storage/lvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lxc/storage/lvm.c b/src/lxc/storage/lvm.c
index e18ba8424..2d4f12d7a 100644
--- a/src/lxc/storage/lvm.c
+++ b/src/lxc/storage/lvm.c
@@ -324,7 +324,7 @@ static int lvm_snapshot_create_new_uuid_wrapper(void *data)
 	if (strcmp(args->fstype, "btrfs") == 0)
 		execlp("btrfstune", "btrfstune", "-f", "-u", args->lv, (char *)NULL);
 
-	return -1;
+	return 0;
 }
 
 static int lvm_snapshot(struct lxc_storage *orig, const char *path, uint64_t size)


More information about the lxc-devel mailing list