X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fmount.c;h=78740a8b2d6ab170008d72e9c5ac9049bdd9d342;hb=257f1d8ec49046c7b481801acfdd5bf57c9efa5c;hp=92e2f734ae696b398aab1e3f4a9eb39993ce2205;hpb=3ef63c317481c2b3f1fe39e1b0f130aac3544522;p=elogind.git diff --git a/src/core/mount.c b/src/core/mount.c index 92e2f734a..78740a8b2 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -959,6 +959,9 @@ static void mount_enter_mounting(Mount *m) { mkdir_p_label(m->where, m->directory_mode); + if (dir_is_empty(m->where) <= 0) + log_notice("%s: Directory %s to mount over is not empty, ignoring. (To see the over-mounted files, please manually mount the underlying file system to a secondary location.)", m->meta.id, m->where); + /* Create the source directory for bind-mounts if needed */ p = get_mount_parameters_fragment(m); if (p && mount_is_bind(p)) @@ -981,7 +984,8 @@ static void mount_enter_mounting(Mount *m) { mount_unwatch_control_pid(m); - if ((r = mount_spawn(m, m->control_command, &m->control_pid)) < 0) + r = mount_spawn(m, m->control_command, &m->control_pid); + if (r < 0) goto fail; mount_set_state(m, MOUNT_MOUNTING);