From: Stefan Agner Date: Mon, 28 Dec 2020 20:46:40 +0000 (+0100) Subject: Avoid error when bind mount source already exists X-Git-Tag: v248-rc1~263 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=237ecfee15988e0f059cd064dde32b00111c6388;p=thirdparty%2Fsystemd.git Avoid error when bind mount source already exists --- diff --git a/src/core/mount.c b/src/core/mount.c index 5479cf7bf21..1ad80886cd0 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -1010,7 +1010,9 @@ static void mount_enter_mounting(Mount *m) { p = get_mount_parameters_fragment(m); if (p && mount_is_bind(p)) { r = mkdir_p_label(p->what, m->directory_mode); - if (r < 0) + /* mkdir_p_label() can return -EEXIST if the target path exists and is not a directory - which is + * totally OK, in case the user wants us to overmount a non-directory inode. */ + if (r < 0 && r != -EEXIST) log_unit_error_errno(UNIT(m), r, "Failed to make bind mount source '%s': %m", p->what); }