All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stef Bon <stef@bononline.nl>
To: Ian Kent <raven@themaw.net>
Cc: autofs@linux.kernel.org
Subject: Re: Automounter stops after reload signal.
Date: Fri, 24 Apr 2009 10:19:19 +0200	[thread overview]
Message-ID: <49F17607.1010606@bononline.nl> (raw)
In-Reply-To: <20090424045400.GA5578@zeus.themaw.net>

Ian Kent wrote:
> Oops, that's not quite right.
> Try this instead, of course the CHANGELOG hunk might not apply.
>
> autofs-5.0.4 - library reload fix update fix
>
> From: Ian Kent <raven@themaw.net>
>
> The library reload fixes introduced a bug which causes autofs to
> incorrectly shutdown. Previously the signal handling thread only
> recieved signals either when they were explicity sent or it was
> time to shutdown so continuing on to call the signal handling
> routine was the correct thing to do. Now we need to join with
> the mount handling thread at exit but, in this case, we don't
> want to continue on to the signal handling routine as that will
> incorrectly cause the signal to be passed on to other mount
> handling threads.
> ---
>
>  CHANGELOG          |    1 +
>  daemon/automount.c |   13 +++++++++++--
>  lib/master.c       |    2 --
>  3 files changed, 12 insertions(+), 4 deletions(-)
>
>
> diff --git a/CHANGELOG b/CHANGELOG
> index 7ca45fd..5e01812 100644
> --- a/CHANGELOG
> +++ b/CHANGELOG
> @@ -44,6 +44,7 @@
>  - use intr option as hosts mount default.
>  - fix kernel includes.
>  - dont umount existing direct mount on master re-read.
> +- fix incorrect shutdown introduced by library relaod fixes.
>  
>  4/11/2008 autofs-5.0.4
>  -----------------------
> diff --git a/daemon/automount.c b/daemon/automount.c
> index 80691fa..d7e3e12 100644
> --- a/daemon/automount.c
> +++ b/daemon/automount.c
> @@ -1332,8 +1332,17 @@ static void *statemachine(void *arg)
>  		case SIGTERM:
>  		case SIGINT:
>  		case SIGUSR2:
> -			if (master_done(master_list))
> -				return NULL;
> +			master_mutex_lock();
> +			if (!list_empty(&master_list->completed)) {
> +				if (master_done(master_list)) {
> +					master_mutex_unlock();
> +					return NULL;
> +				}
> +				master_mutex_unlock();
> +				break;
> +			}
> +			master_mutex_unlock();
> +
>  		case SIGUSR1:
>  			do_signals(master_list, sig);
>  			break;
> diff --git a/lib/master.c b/lib/master.c
> index 762094f..e43f835 100644
> --- a/lib/master.c
> +++ b/lib/master.c
> @@ -1182,7 +1182,6 @@ int master_done(struct master *master)
>  	struct master_mapent *entry;
>  	int res = 0;
>  
> -	master_mutex_lock();
>  	head = &master->completed;
>  	p = head->next;
>  	while (p != head) {
> @@ -1195,7 +1194,6 @@ int master_done(struct master *master)
>  	}
>  	if (list_empty(&master->mounts))
>  		res = 1;
> -	master_mutex_unlock();
>  
>  	return res;
>  }
>
>   
Ok, thanks a lot! I will try this.

Stef Bon

  reply	other threads:[~2009-04-24  8:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-08 16:14 Automounter stops after reload signal Stef Bon
2009-04-12 14:08 ` Ian Kent
2009-04-12 17:59   ` Stef Bon
2009-04-13  5:49     ` Ian Kent
2009-04-13  8:34       ` Stef Bon
2009-04-13  9:01         ` Ian Kent
2009-04-24  4:31           ` Ian Kent
2009-04-24  4:54             ` Ian Kent
2009-04-24  8:19               ` Stef Bon [this message]
2009-05-01  2:40                 ` Ian Kent
2009-05-02 23:52                   ` Stef Bon
2009-05-03  3:16                     ` Ian Kent
  -- strict thread matches above, loose matches on Subject: below --
2009-04-09  8:28 Stef Bon

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=49F17607.1010606@bononline.nl \
    --to=stef@bononline.nl \
    --cc=autofs@linux.kernel.org \
    --cc=raven@themaw.net \
    /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.