[lxc-devel] [lxc/master] conf: do lxc.mount.entry mounts right after lxc.mount.fstab

flx42 on Github lxc-bot at linuxcontainers.org
Tue Apr 16 21:51:46 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 631 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190416/319cc374/attachment.bin>
-------------- next part --------------
From c631115d059b05bf88bf5fcfa716105bede95760 Mon Sep 17 00:00:00 2001
From: Felix Abecassis <fabecassis at nvidia.com>
Date: Tue, 16 Apr 2019 14:40:03 -0700
Subject: [PATCH] conf: do lxc.mount.entry mounts right after lxc.mount.fstab

These configuration options use the same syntax and therefore it seems
more intuitive to have the same behavior for both of them, which is
not the case today since mount hooks and autodev mounts are called
between the two.

See: https://github.com/lxc/lxc/issues/2932

Signed-off-by: Felix Abecassis <fabecassis at nvidia.com>
---
 src/lxc/conf.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 5d381b7137..986cb89b02 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -3546,6 +3546,15 @@ int lxc_setup(struct lxc_handler *handler)
 		return -1;
 	}
 
+	if (!lxc_list_empty(&lxc_conf->mount_list)) {
+		ret = setup_mount_entries(lxc_conf, &lxc_conf->rootfs,
+					  &lxc_conf->mount_list, name, lxcpath);
+		if (ret < 0) {
+			ERROR("Failed to setup mount entries");
+			return -1;
+		}
+	}
+
 	if (lxc_conf->is_execute) {
 		if (execveat_supported()) {
 			int fd;
@@ -3604,15 +3613,6 @@ int lxc_setup(struct lxc_handler *handler)
 		}
 	}
 
-	if (!lxc_list_empty(&lxc_conf->mount_list)) {
-		ret = setup_mount_entries(lxc_conf, &lxc_conf->rootfs,
-					  &lxc_conf->mount_list, name, lxcpath);
-		if (ret < 0) {
-			ERROR("Failed to setup mount entries");
-			return -1;
-		}
-	}
-
 	/* Make sure any start hooks are in the container */
 	if (!verify_start_hooks(lxc_conf)) {
 		ERROR("Failed to verify start hooks");


More information about the lxc-devel mailing list