On Thu, 6 Nov 2008 09:32:31 -0500 Chuck Lever <chuck.lever@xxxxxxxxxx> wrote: > On Nov 6, 2008, at Nov 6, 2008, 7:17 AM, Jeff Layton wrote: > > On Wed, 5 Nov 2008 15:06:51 -0500 > > "J. Bruce Fields" <bfields@xxxxxxxxxxxxxx> wrote: > > > >> These clients will all be shut down by nlm_destroy_host() when we do > >> garbage collection a little later, so this is redundant. > >> > >> XXX: Ask Jeff Layton why he added this again? > >> > >> Signed-off-by: J. Bruce Fields <bfields@xxxxxxxxxxxxxx> > >> --- > >> fs/lockd/host.c | 8 +------- > >> 1 files changed, 1 insertions(+), 7 deletions(-) > >> > >> diff --git a/fs/lockd/host.c b/fs/lockd/host.c > >> index 73c2be2..0387c6b 100644 > >> --- a/fs/lockd/host.c > >> +++ b/fs/lockd/host.c > >> @@ -602,14 +602,8 @@ static void expire_hosts(struct host_table > >> *table) > >> struct hlist_node *pos; > >> struct nlm_host *host; > >> > >> - dprintk("lockd: nuking all hosts...\n"); > >> - for_each_host(host, pos, chain, table) { > >> + for_each_host(host, pos, chain, table) > >> host->h_expires = jiffies - 1; > >> - if (host->h_rpcclnt) { > >> - rpc_shutdown_client(host->h_rpcclnt); > >> - host->h_rpcclnt = NULL; > >> - } > >> - } > >> } > >> > >> /* > > > > Thank goodness for my OC commenting in the BZ I was using to track > > this! > > > > https://bugzilla.redhat.com/show_bug.cgi?id=254195#c4 > > > > IIRC, there is a chicken and egg problem with refcounting -- at > > least in the code at the time that I did this. If there is still > > an active grant callback in queue at the time that nlm_shutdown_hosts > > is called, the h_count will stay high and nlm_destroy_host won't be > > called. This can happen if we try to bring down lockd while trying to > > do a grant callback to an unresponsive client. > > If that's the case, it seems to me what we want is, during lockd > shutdown, a way to forcibly retire all outstanding grant callbacks > before walking the host cache. Isn't that what > nlmsvc_invalidate_all() does? > No, I don't think it does. It tears down the nlm_blocks and such, but in-flight grant callbacks are "disconnected" from the NLM subsystem to a large degree. The NLM subsystem doesn't really have any connection to these RPC's other than via the rpc_client. Note that I'm going from memory here, so recent changes may mean that this is wrong. From a quick glance at the code though, I think it's still correct. -- Jeff Layton <jlayton@xxxxxxxxxx> -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html