daandemeyer / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
2f7d91
From 5b7b538fcd268288cea8d8b7f16f839afbf74f39 Mon Sep 17 00:00:00 2001
2f7d91
From: Lennart Poettering <lennart@poettering.net>
2f7d91
Date: Wed, 28 Nov 2018 12:41:44 +0100
2f7d91
Subject: [PATCH] mount: don't propagate errors from mount_setup_unit() further
2f7d91
 up
2f7d91
2f7d91
If we can't process a specific line in /proc/self/mountinfo we should
2f7d91
log about it (which we do), but this should not affect other lines, nor
2f7d91
further processing of mount units. Let's keep these failures local.
2f7d91
2f7d91
Fixes: #10874
2f7d91
(cherry picked from commit ba0d56f55f2073164799be714b5bd1aad94d059a)
2f7d91
Resolves: #1809159
2f7d91
---
2f7d91
 src/core/mount.c | 9 +++------
2f7d91
 1 file changed, 3 insertions(+), 6 deletions(-)
2f7d91
2f7d91
diff --git a/src/core/mount.c b/src/core/mount.c
2f7d91
index 3167bd6bb1..126038c27f 100644
2f7d91
--- a/src/core/mount.c
2f7d91
+++ b/src/core/mount.c
2f7d91
@@ -1571,7 +1571,7 @@ fail:
2f7d91
 static int mount_load_proc_self_mountinfo(Manager *m, bool set_flags) {
2f7d91
         _cleanup_(mnt_free_tablep) struct libmnt_table *t = NULL;
2f7d91
         _cleanup_(mnt_free_iterp) struct libmnt_iter *i = NULL;
2f7d91
-        int r = 0;
2f7d91
+        int r;
2f7d91
 
2f7d91
         assert(m);
2f7d91
 
2f7d91
@@ -1587,7 +1587,6 @@ static int mount_load_proc_self_mountinfo(Manager *m, bool set_flags) {
2f7d91
         if (r < 0)
2f7d91
                 return log_error_errno(r, "Failed to parse /proc/self/mountinfo: %m");
2f7d91
 
2f7d91
-        r = 0;
2f7d91
         for (;;) {
2f7d91
                 const char *device, *path, *options, *fstype;
2f7d91
                 _cleanup_free_ const char *d = NULL, *p = NULL;
2f7d91
@@ -1615,12 +1614,10 @@ static int mount_load_proc_self_mountinfo(Manager *m, bool set_flags) {
2f7d91
 
2f7d91
                 (void) device_found_node(m, d, true, DEVICE_FOUND_MOUNT, set_flags);
2f7d91
 
2f7d91
-                k = mount_setup_unit(m, d, p, options, fstype, set_flags);
2f7d91
-                if (r == 0 && k < 0)
2f7d91
-                        r = k;
2f7d91
+                (void) mount_setup_unit(m, d, p, options, fstype, set_flags);
2f7d91
         }
2f7d91
 
2f7d91
-        return r;
2f7d91
+        return 0;
2f7d91
 }
2f7d91
 
2f7d91
 static void mount_shutdown(Manager *m) {