Blame SOURCES/autofs-5.1.7-reduce-umount-EBUSY-check-delay.patch

beb904
autofs-5.1.7 - reduce umount EBUSY check delay
beb904
beb904
From: Ian Kent <raven@themaw.net>
beb904
beb904
Some time ago I had to wait and retry umount() for autofs mounts
beb904
becuase I found EBUSY would be returned for a time after the call
beb904
causing false negative umount returns.
beb904
beb904
I think that problem has been resolved but removing the retry is
beb904
probably a little risky.
beb904
beb904
But the wait time is quite long at one fifth of a second so reduce
beb904
that to one twentieth of a second and increase the retries to make
beb904
it more resposive.
beb904
beb904
Signed-off-by: Ian Kent <raven@themaw.net>
beb904
---
beb904
 CHANGELOG           |    1 +
beb904
 daemon/direct.c     |    4 ++--
beb904
 daemon/indirect.c   |    2 +-
beb904
 include/automount.h |    2 +-
beb904
 4 files changed, 5 insertions(+), 4 deletions(-)
beb904
beb904
--- autofs-5.1.4.orig/CHANGELOG
beb904
+++ autofs-5.1.4/CHANGELOG
beb904
@@ -22,6 +22,7 @@
beb904
 - eliminate count_mounts() from expire_proc_indirect().
beb904
 - eliminate some strlen calls in offset handling.
beb904
 - don't add offset mounts to mounted mounts table.
beb904
+- reduce umount EBUSY check delay.
beb904
 
beb904
 xx/xx/2018 autofs-5.1.5
beb904
 - fix flag file permission.
beb904
--- autofs-5.1.4.orig/daemon/direct.c
beb904
+++ autofs-5.1.4/daemon/direct.c
beb904
@@ -150,7 +150,7 @@ int do_umount_autofs_direct(struct autof
beb904
 
beb904
 	retries = UMOUNT_RETRIES;
beb904
 	while ((rv = umount(me->key)) == -1 && retries--) {
beb904
-		struct timespec tm = {0, 200000000};
beb904
+		struct timespec tm = {0, 50000000};
beb904
 		if (errno != EBUSY)
beb904
 			break;
beb904
 		nanosleep(&tm, NULL);
beb904
@@ -573,7 +573,7 @@ int umount_autofs_offset(struct autofs_p
beb904
 
beb904
 	retries = UMOUNT_RETRIES;
beb904
 	while ((rv = umount(me->key)) == -1 && retries--) {
beb904
-		struct timespec tm = {0, 200000000};
beb904
+		struct timespec tm = {0, 50000000};
beb904
 		if (errno != EBUSY)
beb904
 			break;
beb904
 		nanosleep(&tm, NULL);
beb904
--- autofs-5.1.4.orig/daemon/indirect.c
beb904
+++ autofs-5.1.4/daemon/indirect.c
beb904
@@ -265,7 +265,7 @@ int umount_autofs_indirect(struct autofs
beb904
 
beb904
 	retries = UMOUNT_RETRIES;
beb904
 	while ((rv = umount(mountpoint)) == -1 && retries--) {
beb904
-		struct timespec tm = {0, 200000000};
beb904
+		struct timespec tm = {0, 50000000};
beb904
 		if (errno != EBUSY)
beb904
 			break;
beb904
 		nanosleep(&tm, NULL);
beb904
--- autofs-5.1.4.orig/include/automount.h
beb904
+++ autofs-5.1.4/include/automount.h
beb904
@@ -140,7 +140,7 @@ struct autofs_point;
beb904
 #define NULL_MAP_HASHSIZE	64
beb904
 #define NEGATIVE_TIMEOUT	10
beb904
 #define POSITIVE_TIMEOUT	120
beb904
-#define UMOUNT_RETRIES		8
beb904
+#define UMOUNT_RETRIES		16
beb904
 #define EXPIRE_RETRIES		3
beb904
 
beb904
 struct mapent_cache {