* [PATCH] lockd: don't clear sm_monitored on nsm_reboot_lookup
@ 2010-02-05 20:09 Jeff Layton
2010-02-08 21:21 ` J. Bruce Fields
0 siblings, 1 reply; 2+ messages in thread
From: Jeff Layton @ 2010-02-05 20:09 UTC (permalink / raw)
To: bfields; +Cc: linux-nfs
When lockd gets a notify downcall from statd, it'll search its hosts
cache and then clear the sm_monitored bit on the host it finds. The idea
is apparently to make lockd redo a SM_MON on the next lock request.
This is unnecessary and causes the kernel's NSM cache to go out of sync
with statd. statd doesn't stop monitoring a host when it gets a
SM_NOTIFY and there's no guarantee that another lock will occur after
the reclaim and before the unmount. In that event, no SM_UNMON will
occur.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
---
fs/lockd/mon.c | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c
index f956651..fefa4df 100644
--- a/fs/lockd/mon.c
+++ b/fs/lockd/mon.c
@@ -349,9 +349,9 @@ retry:
* nsm_reboot_lookup - match NLMPROC_SM_NOTIFY arguments to an nsm_handle
* @info: pointer to NLMPROC_SM_NOTIFY arguments
*
- * Returns a matching nsm_handle if found in the nsm cache; the returned
- * nsm_handle's reference count is bumped and sm_monitored is cleared.
- * Otherwise returns NULL if some error occurred.
+ * Returns a matching nsm_handle if found in the nsm cache. The returned
+ * nsm_handle's reference count is bumped. Otherwise returns NULL if some
+ * error occurred.
*/
struct nsm_handle *nsm_reboot_lookup(const struct nlm_reboot *info)
{
@@ -370,12 +370,6 @@ struct nsm_handle *nsm_reboot_lookup(const struct nlm_reboot *info)
atomic_inc(&cached->sm_count);
spin_unlock(&nsm_lock);
- /*
- * During subsequent lock activity, force a fresh
- * notification to be set up for this host.
- */
- cached->sm_monitored = 0;
-
dprintk("lockd: host %s (%s) rebooted, cnt %d\n",
cached->sm_name, cached->sm_addrbuf,
atomic_read(&cached->sm_count));
--
1.6.6
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] lockd: don't clear sm_monitored on nsm_reboot_lookup
2010-02-05 20:09 [PATCH] lockd: don't clear sm_monitored on nsm_reboot_lookup Jeff Layton
@ 2010-02-08 21:21 ` J. Bruce Fields
0 siblings, 0 replies; 2+ messages in thread
From: J. Bruce Fields @ 2010-02-08 21:21 UTC (permalink / raw)
To: Jeff Layton; +Cc: linux-nfs
On Fri, Feb 05, 2010 at 03:09:22PM -0500, Jeff Layton wrote:
> When lockd gets a notify downcall from statd, it'll search its hosts
> cache and then clear the sm_monitored bit on the host it finds. The idea
> is apparently to make lockd redo a SM_MON on the next lock request.
>
> This is unnecessary and causes the kernel's NSM cache to go out of sync
> with statd. statd doesn't stop monitoring a host when it gets a
> SM_NOTIFY and there's no guarantee that another lock will occur after
> the reclaim and before the unmount. In that event, no SM_UNMON will
> occur.
Thanks, applied.
--b.
>
> Signed-off-by: Jeff Layton <jlayton@redhat.com>
> Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
> ---
> fs/lockd/mon.c | 12 +++---------
> 1 files changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c
> index f956651..fefa4df 100644
> --- a/fs/lockd/mon.c
> +++ b/fs/lockd/mon.c
> @@ -349,9 +349,9 @@ retry:
> * nsm_reboot_lookup - match NLMPROC_SM_NOTIFY arguments to an nsm_handle
> * @info: pointer to NLMPROC_SM_NOTIFY arguments
> *
> - * Returns a matching nsm_handle if found in the nsm cache; the returned
> - * nsm_handle's reference count is bumped and sm_monitored is cleared.
> - * Otherwise returns NULL if some error occurred.
> + * Returns a matching nsm_handle if found in the nsm cache. The returned
> + * nsm_handle's reference count is bumped. Otherwise returns NULL if some
> + * error occurred.
> */
> struct nsm_handle *nsm_reboot_lookup(const struct nlm_reboot *info)
> {
> @@ -370,12 +370,6 @@ struct nsm_handle *nsm_reboot_lookup(const struct nlm_reboot *info)
> atomic_inc(&cached->sm_count);
> spin_unlock(&nsm_lock);
>
> - /*
> - * During subsequent lock activity, force a fresh
> - * notification to be set up for this host.
> - */
> - cached->sm_monitored = 0;
> -
> dprintk("lockd: host %s (%s) rebooted, cnt %d\n",
> cached->sm_name, cached->sm_addrbuf,
> atomic_read(&cached->sm_count));
> --
> 1.6.6
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-02-08 21:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-05 20:09 [PATCH] lockd: don't clear sm_monitored on nsm_reboot_lookup Jeff Layton
2010-02-08 21:21 ` J. Bruce Fields
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox