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