Blame SOURCES/autofs-5.0.8-fix-inconsistent-error-returns-in-handle_packet_missing_direct.patch

304803
autofs-5.0.8 - fix inconsistent error returns in handle_packet_missing_direct()
304803
304803
From: Ian Kent <raven@themaw.net>
304803
304803
How to handle mount requests that arrive during a shutdown is a big
304803
problem.
304803
304803
Currently common cases result in the requesting process being sent a
304803
fail status and success being returned to the calling autofs process.
304803
304803
There are a number of places where a fail is returned to the calling
304803
process (such as memeory allocation errors) which should cause the
304803
daemon to exit. But when a request arrives during a shutdown the
304803
daemon is usually not ready to shutdown and instead performs recovery
304803
and returns to a ready state instead of shutting down.
304803
304803
There were a few places in handle_packet_missing_direct() where a fail
304803
was being returned when a success should have been returned which was
304803
preventing the completion of the shutdown.
304803
304803
This is not ideal because during a restart of the daemon processes
304803
requesting a mount could receive a mount failure. But this has been
304803
the policy for while now and it's very difficult to do in a different
304803
way.
304803
---
304803
 CHANGELOG       |    1 +
304803
 daemon/direct.c |    6 +++---
304803
 2 files changed, 4 insertions(+), 3 deletions(-)
304803
304803
--- autofs-5.0.7.orig/CHANGELOG
304803
+++ autofs-5.0.7/CHANGELOG
304803
@@ -98,6 +98,7 @@
304803
 - fix fix map source with type lookup.
304803
 - fix lookup_nss_mount() map lookup.
304803
 - dont ignore null cache entries on multi mount umount.
304803
+- fix inconsistent error returns in handle_packet_missing_direct().
304803
 
304803
 25/07/2012 autofs-5.0.7
304803
 =======================
304803
--- autofs-5.0.7.orig/daemon/direct.c
304803
+++ autofs-5.0.7/daemon/direct.c
304803
@@ -1384,7 +1384,7 @@ int handle_packet_missing_direct(struct
304803
 		master_source_unlock(ap->entry);
304803
 		master_mutex_unlock();
304803
 		pthread_setcancelstate(state, NULL);
304803
-		return 1;
304803
+		return 0;
304803
 	}
304803
 
304803
 	/* Check if we recorded a mount fail for this key */
304803
@@ -1409,7 +1409,7 @@ int handle_packet_missing_direct(struct
304803
 		master_source_unlock(ap->entry);
304803
 		master_mutex_unlock();
304803
 		pthread_setcancelstate(state, NULL);
304803
-		return 1;
304803
+		return 0;
304803
 	}
304803
 
304803
 	mt = malloc(sizeof(struct pending_args));
304803
@@ -1423,7 +1423,7 @@ int handle_packet_missing_direct(struct
304803
 		master_source_unlock(ap->entry);
304803
 		master_mutex_unlock();
304803
 		pthread_setcancelstate(state, NULL);
304803
-		return 1;
304803
+		return 0;
304803
 	}
304803
 	memset(mt, 0, sizeof(struct pending_args));
304803