dryang / rpms / systemd

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