dryang / rpms / systemd

Forked from rpms/systemd a year ago
Clone
eb8b6e
From 4662575605089b38d611a911c03c60ec260fde05 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
eb8b6e
(cherry picked from commit ba0d56f55f2073164799be714b5bd1aad94d059a)
eb8b6e
eb8b6e
Resolves: #2039327
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
eb8b6e
index 7e80a0c974..9b1c59b1c3 100644
eb8b6e
--- a/src/core/mount.c
eb8b6e
+++ b/src/core/mount.c
eb8b6e
@@ -1621,12 +1621,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)
eb8b6e
@@ -1650,12 +1648,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) {