teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame SOURCES/0676-core-Fix-edge-case-when-processing-proc-self-mountin.patch

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