X Tutup
Skip to content

Commit 237ecfe

Browse files
agnersyuwata
authored andcommitted
Avoid error when bind mount source already exists
1 parent a306ec1 commit 237ecfe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/core/mount.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,9 @@ static void mount_enter_mounting(Mount *m) {
10101010
p = get_mount_parameters_fragment(m);
10111011
if (p && mount_is_bind(p)) {
10121012
r = mkdir_p_label(p->what, m->directory_mode);
1013-
if (r < 0)
1013+
/* mkdir_p_label() can return -EEXIST if the target path exists and is not a directory - which is
1014+
* totally OK, in case the user wants us to overmount a non-directory inode. */
1015+
if (r < 0 && r != -EEXIST)
10141016
log_unit_error_errno(UNIT(m), r, "Failed to make bind mount source '%s': %m", p->what);
10151017
}
10161018

0 commit comments

Comments
 (0)
X Tutup