anitazha / rpms / systemd

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