All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bill Ryder <bill.ryder.nz@gmail.com>
To: autofs@linux.kernel.org
Subject: [bryder_autofs_4.1.4_PATCH 8/8] Fix race which would stop a daemon under high mount rates with failures
Date: Thu, 13 Jan 2011 11:25:06 +1300	[thread overview]
Message-ID: <934b79623a5580fbab1a257127e5d6152fb58f3f.1295972820.git.bill.ryder.nz@gmail.com> (raw)
In-Reply-To: <cover.1295972820.git.bill.ryder.nz@gmail.com>

---
 CHANGELOG          |   13 +++++++++++++
 daemon/automount.c |    4 ++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index b4959ec..e13e0ac 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,16 @@
+19/07/2010 autofs-4.1.4 - bryder p44
+---------------------------
+  Fix a problem where automount can shut itself down for no good reason.
+  The case I had was  very high rate of failed mounts triggering the
+      if (handle_packet() && errno != EINTR) ; break  
+  piece of code in automount.c:handle_mounts which ended up just shutting down the automounter.
+  The debug statement confirmed it (ap.state was 1 (READY) instead of 6 (SHUTDOWN))
+  The bug is triggered if a child signal is caught when the daemon was not in the middle of a system call - hence errno 
+  was not set to EINTR and handle_packet returned non zero - as in when a mount point didn't exist. 
+  This was  reproducible when using the ignore-stupid-paths option which meant the daemon spent
+  more time in user space handling autofs kernel packets than before.
+
+  
 15/07/2010 autofs-4.1.4 - syslog patch
 --------------------------------------
 
diff --git a/daemon/automount.c b/daemon/automount.c
index 92476b4..0142884 100644
--- a/daemon/automount.c
+++ b/daemon/automount.c
@@ -1729,9 +1729,9 @@ int handle_mounts(char *path)
 		kill(my_pid, SIGSTOP);
 
 	while (ap.state != ST_SHUTDOWN) {
-		if (handle_packet() && errno != EINTR)
-			break;
+		handle_packet();
 	}
+	debug("Shutting down - ap.state is %d if it's not %d (ST_SHUTDOWN) something bad happened ",ap.state,ST_SHUTDOWN);
 
 	/* Mop up remaining kids */
 	handle_child(1);
-- 
1.7.3.4

  parent reply	other threads:[~2011-01-12 22:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-25 16:27 [bryder_autofs_4.1.4_PATCH 0/8] *** SUBJECT HERE *** Bill Ryder
2010-12-14  0:44 ` [bryder_autofs_4.1.4_PATCH 1/8] Added the dumpmap option and updated manpage Bill Ryder
2010-12-14  2:36 ` [bryder_autofs_4.1.4_PATCH 2/8] Set LDAP_DEPRECATED to prevent coredumps with modern ldap libraries Bill Ryder
2010-12-20  1:10 ` [bryder_autofs_4.1.4_PATCH 3/8] Added function names to some debug/crit messages, changed some crits to debug Bill Ryder
2010-12-20 19:30 ` [bryder_autofs_4.1.4_PATCH 4/8] reinstated the jmoyer ldap-cleanup patch and included man etc updates Bill Ryder
2011-01-10  1:27 ` [bryder_autofs_4.1.4_PATCH 5/8] Added option to ignore some highly unlikely paths before forking daemon Bill Ryder
2011-01-12  2:44 ` [bryder_autofs_4.1.4_PATCH 6/8] Adds options to retry nfs mounts on certain nfs errors Bill Ryder
2011-01-12 22:15 ` [bryder_autofs_4.1.4_PATCH 7/8] Ian Kent's reentrant syslog patch Bill Ryder
2011-01-27 14:33   ` Ian Kent
2011-01-12 22:25 ` Bill Ryder [this message]
2011-01-26  0:17 ` [bryder_autofs_4.1.4_PATCH 0/8] *** SUBJECT HERE *** Bill Ryder
  -- strict thread matches above, loose matches on Subject: below --
2011-01-13  3:09 [bryder_autofs_4.1.4_PATCH 0/8] Patches to autofs 4.1.4 daemon to speed some things up and increase robustness Bill Ryder
2011-01-12 22:25 ` [bryder_autofs_4.1.4_PATCH 8/8] Fix race which would stop a daemon under high mount rates with failures Bill Ryder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=934b79623a5580fbab1a257127e5d6152fb58f3f.1295972820.git.bill.ryder.nz@gmail.com \
    --to=bill.ryder.nz@gmail.com \
    --cc=autofs@linux.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.