anitazha / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone

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

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