7ff657
From 403580d6e23991f414526a5fd90fb253210c07ba Mon Sep 17 00:00:00 2001
7ff657
From: Kyle Walker <kwalker@redhat.com>
7ff657
Date: Thu, 21 Mar 2019 15:09:06 -0400
7ff657
Subject: [PATCH] core: Fix edge case when processing /proc/self/mountinfo
7ff657
7ff657
Currently, if there are two /proc/self/mountinfo entries with the same
7ff657
mount point path, the mount setup flags computed for the second of
7ff657
these two entries will overwrite the mount setup flags computed for
7ff657
the first of these two entries. This is the root cause of issue #7798.
7ff657
This patch changes mount_setup_existing_unit to prevent the
7ff657
just_mounted mount setup flag from being overwritten if it is set to
7ff657
true. This will allow all mount units created from /proc/self/mountinfo
7ff657
entries to be initialized properly.
7ff657
7ff657
(cherry picked from commit 65d36b49508a53e56bae9609ff00fdc3de340608)
7ff657
(cherry picked from commit 1c9add7cc78fc65b043f9e87ab63bb2158d2ddf0)
7ff657
7ff657
Resolves: #1722576
7ff657
---
7ff657
 src/core/mount.c | 2 +-
7ff657
 1 file changed, 1 insertion(+), 1 deletion(-)
7ff657
7ff657
diff --git a/src/core/mount.c b/src/core/mount.c
7ff657
index 5fd7a86..c7aed23 100644
7ff657
--- a/src/core/mount.c
7ff657
+++ b/src/core/mount.c
7ff657
@@ -1527,7 +1527,7 @@ static int mount_setup_unit(
7ff657
 
7ff657
         if (set_flags) {
7ff657
                 MOUNT(u)->is_mounted = true;
7ff657
-                MOUNT(u)->just_mounted = !MOUNT(u)->from_proc_self_mountinfo;
7ff657
+                MOUNT(u)->just_mounted = !MOUNT(u)->from_proc_self_mountinfo || MOUNT(u)->just_mounted;
7ff657
                 MOUNT(u)->just_changed = changed;
7ff657
         }
7ff657
 
7ff657
-- 
7ff657
2.21.0
7ff657