diff --git a/daemon/direct.c b/daemon/direct.c
index 529f143..760fbd4 100644
--- a/daemon/direct.c
+++ b/daemon/direct.c
@@ -824,11 +824,16 @@ static int expire_direct(int ioctlfd, const char *path, unsigned int when, unsig
if (errno == EBADF || errno == EINVAL)
return 1;
- /* Other than need to wait for the kernel ? */
- if (errno != EAGAIN)
- return 0;
+ /*
+ * Other than EAGAIN is an expire error so continue.
+ * Kernel try the same mount again, limited by
+ * retries (ie. number of mounts directly under
+ * mount point, should always be one for direct
+ * mounts).
+ */
+ if (errno == EAGAIN)
+ break;
}
-
nanosleep(&tm, NULL);
}
diff --git a/daemon/indirect.c b/daemon/indirect.c
index fd94e59..39b42da 100644
--- a/daemon/indirect.c
+++ b/daemon/indirect.c
@@ -344,11 +344,13 @@ static int expire_indirect(struct autofs_point *ap, int ioctlfd, const char *pat
if (errno == EBADF || errno == EINVAL)
return 1;
- /* Other than need to wait for the kernel ? */
- if (errno != EAGAIN)
- return 0;
+ /*
+ * Other than EAGAIN is an expire error so continue.
+ * Kernel will try the next mount.
+ */
+ if (errno == EAGAIN)
+ break;
}
-
nanosleep(&tm, NULL);
}