From 77aa941e846b70f4448c01402854879d9238acf2 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sun, 7 Mar 2021 01:48:28 +0100 Subject: [PATCH] Mounting devtmpfs may fail if already mounted Ignore EBUSY errors, the kernel has the ability to automount /dev as soon as the rootfs has been mounted. This may be added to procfs and sysfs later, so we make this a general change in fs_init(). Signed-off-by: Joachim Wiberg --- src/finit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/finit.c b/src/finit.c index f126c2a1..71c09009 100644 --- a/src/finit.c +++ b/src/finit.c @@ -207,6 +207,9 @@ static void fs_mount(void) * for early multi-console, and /sys for the cgroups support. Any * occurrence of these file systems in /etc/fstab will replace these * mounts later in fs_mount() + * + * Ignore any mount errors with EBUSY, kernel likely alread mounted + * the filesystem for us automatically, e.g., CONFIG_DEVTMPFS_MOUNT. */ static void fs_init(void) { @@ -223,7 +226,7 @@ static void fs_init(void) int rc; rc = mount(fs[i].spec, fs[i].file, fs[i].type, 0, NULL); - if (rc) + if (rc && errno != EBUSY) _pe("Failed mounting %s on %s", fs[i].spec, fs[i].file); } }