naccyde / rpms / systemd

Forked from rpms/systemd a year ago
Clone
7e7c9f
From 591bcfa98983c97df4dbb9d15bc272c3fc093863 Mon Sep 17 00:00:00 2001
2f7d91
From: David Tardon <dtardon@redhat.com>
2f7d91
Date: Mon, 16 Mar 2020 09:37:22 +0100
2f7d91
Subject: [PATCH] fix the fix for #1691511
2f7d91
2f7d91
The fix for #1691511 should have been used only for existing mounts
2f7d91
(mount_setup_existing_unit() in current master).
2f7d91
7e7c9f
Related: #1804757
2f7d91
---
2f7d91
 src/core/mount.c | 6 +++++-
2f7d91
 1 file changed, 5 insertions(+), 1 deletion(-)
2f7d91
2f7d91
diff --git a/src/core/mount.c b/src/core/mount.c
2f7d91
index 34c4b548ad..56fda1b73f 100644
2f7d91
--- a/src/core/mount.c
2f7d91
+++ b/src/core/mount.c
2f7d91
@@ -1416,6 +1416,7 @@ static int mount_setup_unit(
2f7d91
         bool load_extras = false;
2f7d91
         MountParameters *p;
2f7d91
         bool delete, changed = false;
2f7d91
+        bool just_mounted;
2f7d91
         Unit *u;
2f7d91
         int r;
2f7d91
 
2f7d91
@@ -1489,6 +1490,7 @@ static int mount_setup_unit(
2f7d91
                  * loaded in now. */
2f7d91
                 unit_add_to_load_queue(u);
2f7d91
                 changed = true;
2f7d91
+                just_mounted = true;
2f7d91
         } else {
2f7d91
                 delete = false;
2f7d91
 
2f7d91
@@ -1518,6 +1520,8 @@ static int mount_setup_unit(
2f7d91
                         load_extras = true;
2f7d91
                         changed = true;
2f7d91
                 }
2f7d91
+
2f7d91
+                just_mounted = !MOUNT(u)->from_proc_self_mountinfo || MOUNT(u)->just_mounted;
2f7d91
         }
2f7d91
 
2f7d91
         w = strdup(what);
2f7d91
@@ -1537,7 +1541,7 @@ static int mount_setup_unit(
2f7d91
 
2f7d91
         if (set_flags) {
2f7d91
                 MOUNT(u)->is_mounted = true;
2f7d91
-                MOUNT(u)->just_mounted = !MOUNT(u)->from_proc_self_mountinfo || MOUNT(u)->just_mounted;
2f7d91
+                MOUNT(u)->just_mounted = just_mounted;
2f7d91
                 MOUNT(u)->just_changed = changed;
2f7d91
         }
2f7d91