f27ed14
From 607c7f865e59ca9c286c448f3b6bfaded1df3389 Mon Sep 17 00:00:00 2001
f27ed14
From: Lennart Poettering <lennart@poettering.net>
f27ed14
Date: Tue, 18 Sep 2012 18:59:01 +0200
f27ed14
Subject: [PATCH] automount: also whine if an automount directory is not empty
f27ed14
 (cherry picked from commit
f27ed14
 e872b43c7ee51efb6bd6ca31d79e02af8cc3cb82)
f27ed14
f27ed14
---
f27ed14
 src/core/automount.c | 3 +++
f27ed14
 1 file changed, 3 insertions(+)
f27ed14
f27ed14
diff --git a/src/core/automount.c b/src/core/automount.c
f27ed14
index 5c716ee..7312f86 100644
f27ed14
--- a/src/core/automount.c
f27ed14
+++ b/src/core/automount.c
f27ed14
@@ -503,6 +503,9 @@ static void automount_enter_waiting(Automount *a) {
f27ed14
         /* We knowingly ignore the results of this call */
f27ed14
         mkdir_p_label(a->where, 0555);
f27ed14
 
f27ed14
+        if (dir_is_empty(a->where) <= 0)
f27ed14
+                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.)", a->meta.id, a->where);
f27ed14
+
f27ed14
         if (pipe2(p, O_NONBLOCK|O_CLOEXEC) < 0) {
f27ed14
                 r = -errno;
f27ed14
                 goto fail;