Blob Blame History Raw
autofs-5.1.7 - reduce umount EBUSY check delay

From: Ian Kent <raven@themaw.net>

Some time ago I had to wait and retry umount() for autofs mounts
becuase I found EBUSY would be returned for a time after the call
causing false negative umount returns.

I think that problem has been resolved but removing the retry is
probably a little risky.

But the wait time is quite long at one fifth of a second so reduce
that to one twentieth of a second and increase the retries to make
it more resposive.

Signed-off-by: Ian Kent <raven@themaw.net>
---
 CHANGELOG           |    1 +
 daemon/direct.c     |    4 ++--
 daemon/indirect.c   |    2 +-
 include/automount.h |    2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)

--- autofs-5.1.4.orig/CHANGELOG
+++ autofs-5.1.4/CHANGELOG
@@ -22,6 +22,7 @@
 - eliminate count_mounts() from expire_proc_indirect().
 - eliminate some strlen calls in offset handling.
 - don't add offset mounts to mounted mounts table.
+- reduce umount EBUSY check delay.
 
 xx/xx/2018 autofs-5.1.5
 - fix flag file permission.
--- autofs-5.1.4.orig/daemon/direct.c
+++ autofs-5.1.4/daemon/direct.c
@@ -150,7 +150,7 @@ int do_umount_autofs_direct(struct autof
 
 	retries = UMOUNT_RETRIES;
 	while ((rv = umount(me->key)) == -1 && retries--) {
-		struct timespec tm = {0, 200000000};
+		struct timespec tm = {0, 50000000};
 		if (errno != EBUSY)
 			break;
 		nanosleep(&tm, NULL);
@@ -573,7 +573,7 @@ int umount_autofs_offset(struct autofs_p
 
 	retries = UMOUNT_RETRIES;
 	while ((rv = umount(me->key)) == -1 && retries--) {
-		struct timespec tm = {0, 200000000};
+		struct timespec tm = {0, 50000000};
 		if (errno != EBUSY)
 			break;
 		nanosleep(&tm, NULL);
--- autofs-5.1.4.orig/daemon/indirect.c
+++ autofs-5.1.4/daemon/indirect.c
@@ -265,7 +265,7 @@ int umount_autofs_indirect(struct autofs
 
 	retries = UMOUNT_RETRIES;
 	while ((rv = umount(mountpoint)) == -1 && retries--) {
-		struct timespec tm = {0, 200000000};
+		struct timespec tm = {0, 50000000};
 		if (errno != EBUSY)
 			break;
 		nanosleep(&tm, NULL);
--- autofs-5.1.4.orig/include/automount.h
+++ autofs-5.1.4/include/automount.h
@@ -140,7 +140,7 @@ struct autofs_point;
 #define NULL_MAP_HASHSIZE	64
 #define NEGATIVE_TIMEOUT	10
 #define POSITIVE_TIMEOUT	120
-#define UMOUNT_RETRIES		8
+#define UMOUNT_RETRIES		16
 #define EXPIRE_RETRIES		3
 
 struct mapent_cache {