chiark / gitweb /
mount: fix for complex automounts
authorMalte Starostik <m-starostik@versanet.de>
Tue, 5 Jun 2012 19:10:28 +0000 (21:10 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 10 Jul 2012 16:27:03 +0000 (18:27 +0200)
If accessing an automount point triggers more changes to
/proc/self/mountinfo than just to add the directly wanted mount, these
changes can lead to spurious -ENODEV notifications on the automount unit
causing the request to fail when in fact the mount will be setup right
afterwards.

src/core/mount.c

index 69cb6e24e4b23861b07ea8664de3c7befb889afa..fab922ea9ef1dd8fa742e8086062f9a139fc3efb 100644 (file)
@@ -687,8 +687,10 @@ static void mount_set_state(Mount *m, MountState state) {
                  state == MOUNT_REMOUNTING_SIGKILL ||
                  state == MOUNT_UNMOUNTING_SIGTERM ||
                  state == MOUNT_UNMOUNTING_SIGKILL ||
-                 state == MOUNT_FAILED)
-                mount_notify_automount(m, -ENODEV);
+                 state == MOUNT_FAILED) {
+               if (state != old_state)
+                       mount_notify_automount(m, -ENODEV);
+       }
 
         if (state != old_state)
                 log_debug("%s changed %s -> %s",