ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
3d3dc8
From c236734f95550747c4979fe318e3a890adaa0a94 Mon Sep 17 00:00:00 2001
3d3dc8
From: Lennart Poettering <lennart@poettering.net>
3d3dc8
Date: Wed, 28 Nov 2018 12:41:44 +0100
3d3dc8
Subject: [PATCH] mount: don't propagate errors from mount_setup_unit() further
3d3dc8
 up
3d3dc8
3d3dc8
If we can't process a specific line in /proc/self/mountinfo we should
3d3dc8
log about it (which we do), but this should not affect other lines, nor
3d3dc8
further processing of mount units. Let's keep these failures local.
3d3dc8
3d3dc8
Fixes: #10874
3d3dc8
3d3dc8
Cherry picked from commit ba0d56f55f2073164799be714b5bd1aad94d059a.
3d3dc8
Trivial conflict in src/core/mount.c, function mount_load_proc_self_mountinfo,
3d3dc8
due to local commit ca634baa10e. Also, due to the same commit, int k
3d3dc8
is no longer used and is thus removed.
3d3dc8
3d3dc8
Resolves: #2036853
3d3dc8
3d3dc8
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
3d3dc8
---
3d3dc8
 src/core/mount.c | 8 ++------
3d3dc8
 1 file changed, 2 insertions(+), 6 deletions(-)
3d3dc8
3d3dc8
diff --git a/src/core/mount.c b/src/core/mount.c
3d3dc8
index 691b23ca74..4e0a4f238a 100644
3d3dc8
--- a/src/core/mount.c
3d3dc8
+++ b/src/core/mount.c
3d3dc8
@@ -1615,12 +1615,10 @@ static int mount_load_proc_self_mountinfo(Manager *m, bool set_flags) {
3d3dc8
         if (r < 0)
3d3dc8
                 return log_error_errno(r, "Failed to parse /proc/self/mountinfo: %m");
3d3dc8
 
3d3dc8
-        r = 0;
3d3dc8
         for (;;) {
3d3dc8
                 struct libmnt_fs *fs;
3d3dc8
                 const char *device, *path, *options, *fstype;
3d3dc8
                 _cleanup_free_ char *d = NULL, *p = NULL;
3d3dc8
-                int k;
3d3dc8
 
3d3dc8
                 r = mnt_table_next_fs(table, iter, &fs);
3d3dc8
                 if (r == 1)
3d3dc8
@@ -1644,12 +1642,10 @@ static int mount_load_proc_self_mountinfo(Manager *m, bool set_flags) {
3d3dc8
 
3d3dc8
                 device_found_node(m, d, DEVICE_FOUND_MOUNT, DEVICE_FOUND_MOUNT);
3d3dc8
 
3d3dc8
-                k = mount_setup_unit(m, d, p, options, fstype, set_flags);
3d3dc8
-                if (r == 0 && k < 0)
3d3dc8
-                        r = k;
3d3dc8
+                (void) mount_setup_unit(m, d, p, options, fstype, set_flags);
3d3dc8
         }
3d3dc8
 
3d3dc8
-        return r;
3d3dc8
+        return 0;
3d3dc8
 }
3d3dc8
 
3d3dc8
 static void mount_shutdown(Manager *m) {