ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
923a60
From 110af4eeadeec6e901d1189ed914d04fb8b60e13 Mon Sep 17 00:00:00 2001
923a60
From: Daniel Mack <daniel@zonque.org>
923a60
Date: Tue, 7 Apr 2015 00:44:15 +0200
923a60
Subject: [PATCH] core: mount-setup: handle non-existing mountpoints gracefully
923a60
923a60
Commit e792e890f ("path-util: don't eat up ENOENT in
923a60
path_is_mount_point()") changed path_is_mount_point() so it doesn't hide
923a60
-ENOENT from its caller. This causes all boots to fail early in case
923a60
any of the mount points does not exist (for instance, when kdbus isn't
923a60
loaded, /sys/fs/kdbus is missing).
923a60
923a60
Fix this by returning 0 from mount_one() if path_is_mount_point()
923a60
returned -ENOENT.
923a60
923a60
(cherry picked from commit b604cb9bf6a14d12589e85b82f3f59db93ea0029)
923a60
923a60
Resolves: #1585411
923a60
---
923a60
 src/core/mount-setup.c | 3 +++
923a60
 1 file changed, 3 insertions(+)
923a60
923a60
diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c
923a60
index ed493cbe36..71f07b6e2c 100644
923a60
--- a/src/core/mount-setup.c
923a60
+++ b/src/core/mount-setup.c
923a60
@@ -163,6 +163,9 @@ static int mount_one(const MountPoint *p, bool relabel) {
923a60
                 label_fix(p->where, true, true);
923a60
 
923a60
         r = path_is_mount_point(p->where, true);
923a60
+        if (r == -ENOENT)
923a60
+                return 0;
923a60
+
923a60
         if (r < 0)
923a60
                 return r;
923a60