Skip to content

Commit

Permalink
core/mount: fail early if directory cannot be created
Browse files Browse the repository at this point in the history
Prompted by #22334.
  • Loading branch information
yuwata committed Feb 2, 2022
1 parent 891c9b3 commit e4de58c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -1027,8 +1027,10 @@ static void mount_enter_mounting(Mount *m) {
r = mkdir_p_label(p->what, m->directory_mode);
/* 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)
if (r < 0 && r != -EEXIST) {
log_unit_error_errno(UNIT(m), r, "Failed to make bind mount source '%s': %m", p->what);
goto fail;
}
}

if (p) {
Expand Down

0 comments on commit e4de58c

Please sign in to comment.