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

29d2b9
autofs-5.1.7 - reduce umount EBUSY check delay
29d2b9
29d2b9
From: Ian Kent <raven@themaw.net>
29d2b9
29d2b9
Some time ago I had to wait and retry umount() for autofs mounts
29d2b9
becuase I found EBUSY would be returned for a time after the call
29d2b9
causing false negative umount returns.
29d2b9
29d2b9
I think that problem has been resolved but removing the retry is
29d2b9
probably a little risky.
29d2b9
29d2b9
But the wait time is quite long at one fifth of a second so reduce
29d2b9
that to one twentieth of a second and increase the retries to make
29d2b9
it more resposive.
29d2b9
29d2b9
Signed-off-by: Ian Kent <raven@themaw.net>
29d2b9
---
29d2b9
 CHANGELOG           |    1 +
29d2b9
 daemon/direct.c     |    4 ++--
29d2b9
 daemon/indirect.c   |    2 +-
29d2b9
 include/automount.h |    2 +-
29d2b9
 4 files changed, 5 insertions(+), 4 deletions(-)
29d2b9
29d2b9
diff --git a/CHANGELOG b/CHANGELOG
29d2b9
index b144f6aa..6419052d 100644
29d2b9
--- a/CHANGELOG
29d2b9
+++ b/CHANGELOG
29d2b9
@@ -23,6 +23,7 @@
29d2b9
 - eliminate count_mounts() from expire_proc_indirect().
29d2b9
 - eliminate some strlen calls in offset handling.
29d2b9
 - don't add offset mounts to mounted mounts table.
29d2b9
+- reduce umount EBUSY check delay.
29d2b9
 
29d2b9
 25/01/2021 autofs-5.1.7
29d2b9
 - make bind mounts propagation slave by default.
29d2b9
diff --git a/daemon/direct.c b/daemon/direct.c
29d2b9
index fbfebbdd..5c1146a7 100644
29d2b9
--- a/daemon/direct.c
29d2b9
+++ b/daemon/direct.c
29d2b9
@@ -150,7 +150,7 @@ int do_umount_autofs_direct(struct autofs_point *ap, struct mapent *me)
29d2b9
 
29d2b9
 	retries = UMOUNT_RETRIES;
29d2b9
 	while ((rv = umount(me->key)) == -1 && retries--) {
29d2b9
-		struct timespec tm = {0, 200000000};
29d2b9
+		struct timespec tm = {0, 50000000};
29d2b9
 		if (errno != EBUSY)
29d2b9
 			break;
29d2b9
 		nanosleep(&tm, NULL);
29d2b9
@@ -573,7 +573,7 @@ int umount_autofs_offset(struct autofs_point *ap, struct mapent *me)
29d2b9
 
29d2b9
 	retries = UMOUNT_RETRIES;
29d2b9
 	while ((rv = umount(me->key)) == -1 && retries--) {
29d2b9
-		struct timespec tm = {0, 200000000};
29d2b9
+		struct timespec tm = {0, 50000000};
29d2b9
 		if (errno != EBUSY)
29d2b9
 			break;
29d2b9
 		nanosleep(&tm, NULL);
29d2b9
diff --git a/daemon/indirect.c b/daemon/indirect.c
29d2b9
index eddcfff7..9f2ca6a0 100644
29d2b9
--- a/daemon/indirect.c
29d2b9
+++ b/daemon/indirect.c
29d2b9
@@ -265,7 +265,7 @@ int umount_autofs_indirect(struct autofs_point *ap, const char *root)
29d2b9
 
29d2b9
 	retries = UMOUNT_RETRIES;
29d2b9
 	while ((rv = umount(mountpoint)) == -1 && retries--) {
29d2b9
-		struct timespec tm = {0, 200000000};
29d2b9
+		struct timespec tm = {0, 50000000};
29d2b9
 		if (errno != EBUSY)
29d2b9
 			break;
29d2b9
 		nanosleep(&tm, NULL);
29d2b9
diff --git a/include/automount.h b/include/automount.h
29d2b9
index 69445b92..fa6f5d63 100644
29d2b9
--- a/include/automount.h
29d2b9
+++ b/include/automount.h
29d2b9
@@ -140,7 +140,7 @@ struct autofs_point;
29d2b9
 #define NULL_MAP_HASHSIZE	64
29d2b9
 #define NEGATIVE_TIMEOUT	10
29d2b9
 #define POSITIVE_TIMEOUT	120
29d2b9
-#define UMOUNT_RETRIES		8
29d2b9
+#define UMOUNT_RETRIES		16
29d2b9
 #define EXPIRE_RETRIES		3
29d2b9
 
29d2b9
 struct mapent_cache {