]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
conf: don't accidently double-mount 3307/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 19 Mar 2020 12:11:03 +0000 (13:11 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 19 Mar 2020 12:11:03 +0000 (13:11 +0100)
Closes #3073.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/conf.c

index 40db20c3fee976327ac6bd7089d99cbe3199b34c..5c280c3815b1c9bd869a371ff94e16532b354118 100644 (file)
@@ -1847,17 +1847,15 @@ static int mount_entry(const char *fsname, const char *target,
        }
 
        if ((mountflags & MS_REMOUNT) || (mountflags & MS_BIND)) {
-               unsigned long rqd_flags = 0;
+               unsigned long required_flags = 0;
 
                DEBUG("Remounting \"%s\" on \"%s\" to respect bind or remount options",
                      srcpath ? srcpath : "(none)", target ? target : "(none)");
 
                if (mountflags & MS_RDONLY)
-                       rqd_flags |= MS_RDONLY;
+                       required_flags |= MS_RDONLY;
 #ifdef HAVE_STATVFS
                if (srcpath && statvfs(srcpath, &sb) == 0) {
-                       unsigned long required_flags = rqd_flags;
-
                        if (sb.f_flag & MS_NOSUID)
                                required_flags |= MS_NOSUID;
 
@@ -1878,8 +1876,7 @@ static int mount_entry(const char *fsname, const char *target,
                         * mountflags, then skip the remount.
                         */
                        if (!(mountflags & MS_REMOUNT)) {
-                               if (!(required_flags & ~mountflags) &&
-                                   rqd_flags == 0) {
+                               if (!(required_flags & ~mountflags)) {
                                        DEBUG("Mountflags already were %lu, skipping remount", mountflags);
                                        goto skipremount;
                                }