dcavalca / rpms / systemd

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