valeriyvdovin / rpms / systemd

Forked from rpms/systemd 4 years ago
Clone

Blame SOURCES/0327-mount-remove-obsolete-n.patch

803fb7
From 9592604df60795ad8b58aa11311a26f267385bae Mon Sep 17 00:00:00 2001
803fb7
From: Karel Zak <kzak@redhat.com>
803fb7
Date: Tue, 28 Jul 2015 11:31:45 +0200
803fb7
Subject: [PATCH] mount: remove obsolete -n
803fb7
803fb7
It seems that systemd still uses legacy -n option. The option has been
803fb7
originally designed to avoid write to /etc/mtab during boot when root
803fb7
FS is not ready or read-only.
803fb7
803fb7
This is not necessary for long time, because /etc/mtab is not a real
803fb7
file (it's symlink) and write to the file is impossible. All utils
803fb7
should be able to detect the symlink and ignore mtab. This concept is
803fb7
supported for very long time before systemd.
803fb7
803fb7
The userspase mount options are currently maintained by libmount
803fb7
(mount(8) and mount.nfs) in /run/mount) which is tmpfs initialized
803fb7
during early boot.
803fb7
803fb7
(cherry picked from commit 6f20f850f79df365c2533195214127142013d317)
803fb7
Resolves: #1339721
803fb7
---
803fb7
 src/core/mount.c | 6 ------
803fb7
 1 file changed, 6 deletions(-)
803fb7
803fb7
diff --git a/src/core/mount.c b/src/core/mount.c
803fb7
index 23f63ce32..fe967bc03 100644
803fb7
--- a/src/core/mount.c
803fb7
+++ b/src/core/mount.c
803fb7
@@ -881,8 +881,6 @@ static void mount_enter_unmounting(Mount *m) {
803fb7
         m->control_command = m->exec_command + MOUNT_EXEC_UNMOUNT;
803fb7
 
803fb7
         r = exec_command_set(m->control_command, "/bin/umount", m->where, NULL);
803fb7
-        if (r >= 0 && UNIT(m)->manager->running_as == SYSTEMD_SYSTEM)
803fb7
-                r = exec_command_append(m->control_command, "-n", NULL);
803fb7
         if (r < 0)
803fb7
                 goto fail;
803fb7
 
803fb7
@@ -935,8 +933,6 @@ static void mount_enter_mounting(Mount *m) {
803fb7
 
803fb7
                 r = exec_command_set(m->control_command, "/bin/mount",
803fb7
                                      m->parameters_fragment.what, m->where, NULL);
803fb7
-                if (r >= 0 && UNIT(m)->manager->running_as == SYSTEMD_SYSTEM)
803fb7
-                        r = exec_command_append(m->control_command, "-n", NULL);
803fb7
                 if (r >= 0 && m->sloppy_options)
803fb7
                         r = exec_command_append(m->control_command, "-s", NULL);
803fb7
                 if (r >= 0 && m->parameters_fragment.fstype)
803fb7
@@ -985,8 +981,6 @@ static void mount_enter_remounting(Mount *m) {
803fb7
                 r = exec_command_set(m->control_command, "/bin/mount",
803fb7
                                      m->parameters_fragment.what, m->where,
803fb7
                                      "-o", o, NULL);
803fb7
-                if (r >= 0 && UNIT(m)->manager->running_as == SYSTEMD_SYSTEM)
803fb7
-                        r = exec_command_append(m->control_command, "-n", NULL);
803fb7
                 if (r >= 0 && m->sloppy_options)
803fb7
                         r = exec_command_append(m->control_command, "-s", NULL);
803fb7
                 if (r >= 0 && m->parameters_fragment.fstype)