]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
conf: do lxc.mount.entry mounts right after lxc.mount.fstab
authorFelix Abecassis <fabecassis@nvidia.com>
Tue, 16 Apr 2019 21:40:03 +0000 (14:40 -0700)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sat, 18 May 2019 09:21:17 +0000 (11:21 +0200)
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@nvidia.com>
src/lxc/conf.c

index aaf601e07ecee79b80ad48e94c3065cf1fb218fc..c4d6dd4334b4a46bc3f53fe8b7e0cf05dd0fb80d 100644 (file)
@@ -3493,6 +3493,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;
@@ -3551,15 +3560,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");