]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mount: don't propagate errors from mount_setup_unit() further up
authorLennart Poettering <lennart@poettering.net>
Wed, 28 Nov 2018 11:41:44 +0000 (12:41 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 7 Dec 2018 16:30:14 +0000 (17:30 +0100)
If we can't process a specific line in /proc/self/mountinfo we should
log about it (which we do), but this should not affect other lines, nor
further processing of mount units. Let's keep these failures local.

Fixes: #10874
src/core/mount.c

index f5aa90e3df9b6f372d4c1edc9700b62605fb74d4..76715077350b32c8a014dcd472b9aa96d42f6cff 100644 (file)
@@ -1614,7 +1614,7 @@ fail:
 static int mount_load_proc_self_mountinfo(Manager *m, bool set_flags) {
         _cleanup_(mnt_free_tablep) struct libmnt_table *t = NULL;
         _cleanup_(mnt_free_iterp) struct libmnt_iter *i = NULL;
-        int r = 0;
+        int r;
 
         assert(m);
 
@@ -1627,7 +1627,6 @@ static int mount_load_proc_self_mountinfo(Manager *m, bool set_flags) {
         if (r < 0)
                 return log_error_errno(r, "Failed to parse /proc/self/mountinfo: %m");
 
-        r = 0;
         for (;;) {
                 struct libmnt_fs *fs;
                 const char *device, *path, *options, *fstype;
@@ -1656,12 +1655,10 @@ static int mount_load_proc_self_mountinfo(Manager *m, bool set_flags) {
 
                 device_found_node(m, d, DEVICE_FOUND_MOUNT, DEVICE_FOUND_MOUNT);
 
-                k = mount_setup_unit(m, d, p, options, fstype, set_flags);
-                if (r == 0 && k < 0)
-                        r = k;
+                (void) mount_setup_unit(m, d, p, options, fstype, set_flags);
         }
 
-        return r;
+        return 0;
 }
 
 static void mount_shutdown(Manager *m) {