]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: Fix edge case when processing /proc/self/mountinfo (#7811)
authorrkolchmeyer <rkolchmeyer@users.noreply.github.com>
Fri, 5 Jan 2018 18:28:23 +0000 (10:28 -0800)
committerLennart Poettering <lennart@poettering.net>
Fri, 5 Jan 2018 18:28:23 +0000 (19:28 +0100)
Currently, if there are two /proc/self/mountinfo entries with the same
mount point path, the mount setup flags computed for the second of
these two entries will overwrite the mount setup flags computed for
the first of these two entries. This is the root cause of issue #7798.
This patch changes mount_setup_existing_unit to prevent the
just_mounted mount setup flag from being overwritten if it is set to
true. This will allow all mount units created from /proc/self/mountinfo
entries to be initialized properly.

Fixes: #7798
src/core/mount.c

index b25bb9cb403f73e70cbe6aa22b38d1a9b41835c8..9367869f7810d9833277c996d8773149b8d71d86 100644 (file)
@@ -1486,7 +1486,7 @@ static int mount_setup_existing_unit(
 
         flags->just_changed = r1 > 0 || r2 > 0 || r3 > 0;
         flags->is_mounted = true;
-        flags->just_mounted = !MOUNT(u)->from_proc_self_mountinfo;
+        flags->just_mounted = !MOUNT(u)->from_proc_self_mountinfo || MOUNT(u)->just_mounted;
 
         MOUNT(u)->from_proc_self_mountinfo = true;