Linux NFS development
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Jeff Layton <jlayton@redhat.com>
Cc: neilb@suse.de, linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/2] NLM: tear down RPC clients in nlm_shutdown_hosts
Date: Mon, 28 Jan 2008 18:18:26 -0500	[thread overview]
Message-ID: <20080128231826.GU16785@fieldses.org> (raw)
In-Reply-To: <1201548551-23592-2-git-send-email-jlayton@redhat.com>

On Mon, Jan 28, 2008 at 02:29:10PM -0500, Jeff Layton wrote:
> It's possible for a RPC to outlive the lockd daemon that created it, so
> we need to make sure that all RPC's are killed when lockd is coming
> down. When nlm_shutdown_hosts is called, kill off all RPC tasks
> associated with the host. Since we need to wait until they have all gone
> away, we might as well just shut down the RPC client altogether.
> 
> Signed-off-by: Jeff Layton <jlayton@redhat.com>
> ---
>  fs/lockd/host.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/lockd/host.c b/fs/lockd/host.c
> index ebec009..ca6b16f 100644
> --- a/fs/lockd/host.c
> +++ b/fs/lockd/host.c
> @@ -379,8 +379,13 @@ nlm_shutdown_hosts(void)
>  	/* First, make all hosts eligible for gc */
>  	dprintk("lockd: nuking all hosts...\n");
>  	for (chain = nlm_hosts; chain < nlm_hosts + NLM_HOST_NRHASH; ++chain) {
> -		hlist_for_each_entry(host, pos, chain, h_hash)
> +		hlist_for_each_entry(host, pos, chain, h_hash) {
>  			host->h_expires = jiffies - 1;
> +			if (host->h_rpcclnt) {

So the only difference from the previous patch is this test and the
following assignment?  OK.

--b.

> +				rpc_shutdown_client(host->h_rpcclnt);
> +				host->h_rpcclnt = NULL;
> +			}
> +		}
>  	}
>  
>  	/* Then, perform a garbage collection pass */
> -- 
> 1.5.3.7
> 

  parent reply	other threads:[~2008-01-28 23:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-28 19:29 [PATCH 0/2] NLM: fix use after free in lockd Jeff Layton
2008-01-28 19:29 ` [PATCH 1/2] NLM: tear down RPC clients in nlm_shutdown_hosts Jeff Layton
2008-01-28 19:29   ` [PATCH 2/2] NLM: break out of nlmsvc_retry_blocked if lockd is coming down Jeff Layton
2008-01-29  0:05     ` J. Bruce Fields
2008-01-29  1:12       ` Jeff Layton
     [not found]         ` <20080128201210.376097e6-RtJpwOs3+0O+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2008-01-29  1:23           ` J. Bruce Fields
2008-01-29  2:29             ` Jeff Layton
     [not found]               ` <20080128212942.77035005-PC62bkCOHzGdMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2008-01-29  3:02                 ` J. Bruce Fields
2008-01-29 11:23                   ` Jeff Layton
     [not found]                     ` <20080129062312.33ba5a54-RtJpwOs3+0O+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2008-01-29 12:32                       ` Jeff Layton
     [not found]                         ` <20080129073241.7c5c2ef1-RtJpwOs3+0O+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2008-01-29 14:41                           ` J. Bruce Fields
2008-01-28 23:18   ` J. Bruce Fields [this message]
2008-01-29  0:04     ` [PATCH 1/2] NLM: tear down RPC clients in nlm_shutdown_hosts Jeff Layton

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=20080128231826.GU16785@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=jlayton@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox