* [PATCH] nlm_shutdown_hosts_net() cleanup
@ 2017-10-30 13:47 Vasily Averin
2017-10-30 14:49 ` J. Bruce Fields
0 siblings, 1 reply; 4+ messages in thread
From: Vasily Averin @ 2017-10-30 13:47 UTC (permalink / raw)
To: linux-nfs, linux-kernel; +Cc: J. Bruce Fields, Jeff Layton
nlm_complain_hosts() walk through nlm_server_hosts hlist that should be
protected by nlm_host_mutex.
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
fs/lockd/host.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index d716c99..089c1d7 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -617,9 +617,8 @@ nlm_shutdown_hosts_net(struct net *net)
/* Then, perform a garbage collection pass */
nlm_gc_hosts(net);
- mutex_unlock(&nlm_host_mutex);
-
nlm_complain_hosts(net);
+ mutex_unlock(&nlm_host_mutex);
}
/*
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] nlm_shutdown_hosts_net() cleanup
2017-10-30 13:47 [PATCH] nlm_shutdown_hosts_net() cleanup Vasily Averin
@ 2017-10-30 14:49 ` J. Bruce Fields
2017-10-30 14:58 ` Vasily Averin
2017-10-30 15:49 ` Jeff Layton
0 siblings, 2 replies; 4+ messages in thread
From: J. Bruce Fields @ 2017-10-30 14:49 UTC (permalink / raw)
To: Vasily Averin; +Cc: linux-nfs, linux-kernel, Jeff Layton
On Mon, Oct 30, 2017 at 04:47:58PM +0300, Vasily Averin wrote:
> nlm_complain_hosts() walk through nlm_server_hosts hlist that should be
> protected by nlm_host_mutex.
I haven't looked at the NLM locking in ages. Do we know who else might
actually be accessing this list concurrently?
--b.
>
> Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
> ---
> fs/lockd/host.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/lockd/host.c b/fs/lockd/host.c
> index d716c99..089c1d7 100644
> --- a/fs/lockd/host.c
> +++ b/fs/lockd/host.c
> @@ -617,9 +617,8 @@ nlm_shutdown_hosts_net(struct net *net)
>
> /* Then, perform a garbage collection pass */
> nlm_gc_hosts(net);
> - mutex_unlock(&nlm_host_mutex);
> -
> nlm_complain_hosts(net);
> + mutex_unlock(&nlm_host_mutex);
> }
>
> /*
> --
> 2.7.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nlm_shutdown_hosts_net() cleanup
2017-10-30 14:49 ` J. Bruce Fields
@ 2017-10-30 14:58 ` Vasily Averin
2017-10-30 15:49 ` Jeff Layton
1 sibling, 0 replies; 4+ messages in thread
From: Vasily Averin @ 2017-10-30 14:58 UTC (permalink / raw)
To: J. Bruce Fields; +Cc: linux-nfs, linux-kernel, Jeff Layton
On 2017-10-30 17:49, J. Bruce Fields wrote:
> On Mon, Oct 30, 2017 at 04:47:58PM +0300, Vasily Averin wrote:
>> nlm_complain_hosts() walk through nlm_server_hosts hlist that should be
>> protected by nlm_host_mutex.
>
> I haven't looked at the NLM locking in ages. Do we know who else might
> actually be accessing this list concurrently?
Thank you for the question, I'll investigate it.
>> Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
>> ---
>> fs/lockd/host.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/fs/lockd/host.c b/fs/lockd/host.c
>> index d716c99..089c1d7 100644
>> --- a/fs/lockd/host.c
>> +++ b/fs/lockd/host.c
>> @@ -617,9 +617,8 @@ nlm_shutdown_hosts_net(struct net *net)
>>
>> /* Then, perform a garbage collection pass */
>> nlm_gc_hosts(net);
>> - mutex_unlock(&nlm_host_mutex);
>> -
>> nlm_complain_hosts(net);
>> + mutex_unlock(&nlm_host_mutex);
>> }
>>
>> /*
>> --
>> 2.7.4
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nlm_shutdown_hosts_net() cleanup
2017-10-30 14:49 ` J. Bruce Fields
2017-10-30 14:58 ` Vasily Averin
@ 2017-10-30 15:49 ` Jeff Layton
1 sibling, 0 replies; 4+ messages in thread
From: Jeff Layton @ 2017-10-30 15:49 UTC (permalink / raw)
To: J. Bruce Fields, Vasily Averin; +Cc: linux-nfs, linux-kernel
On Mon, 2017-10-30 at 10:49 -0400, J. Bruce Fields wrote:
> On Mon, Oct 30, 2017 at 04:47:58PM +0300, Vasily Averin wrote:
> > nlm_complain_hosts() walk through nlm_server_hosts hlist that should be
> > protected by nlm_host_mutex.
>
> I haven't looked at the NLM locking in ages. Do we know who else might
> actually be accessing this list concurrently?
>
> --b.
>
Since this is a per-net-ns shutdown, I suppose you could have concurrent
rpc.nfsd's shutting down different namespaces. Holding the mutex for
longer looks like a reasonable fix.
That said...I don't think lockd was ever properly namespace-ified. YMMV
here.
> >
> > Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
> > ---
> > fs/lockd/host.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/fs/lockd/host.c b/fs/lockd/host.c
> > index d716c99..089c1d7 100644
> > --- a/fs/lockd/host.c
> > +++ b/fs/lockd/host.c
> > @@ -617,9 +617,8 @@ nlm_shutdown_hosts_net(struct net *net)
> >
> > /* Then, perform a garbage collection pass */
> > nlm_gc_hosts(net);
> > - mutex_unlock(&nlm_host_mutex);
> > -
> > nlm_complain_hosts(net);
> > + mutex_unlock(&nlm_host_mutex);
> > }
> >
> > /*
> > --
> > 2.7.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
You can add:
Reviewed-by: Jeff Layton <jlayton@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-10-30 15:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-30 13:47 [PATCH] nlm_shutdown_hosts_net() cleanup Vasily Averin
2017-10-30 14:49 ` J. Bruce Fields
2017-10-30 14:58 ` Vasily Averin
2017-10-30 15:49 ` Jeff Layton
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.