naccyde / rpms / systemd

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