All of lore.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Andrew Morton <akpm@osdl.org>
Cc: nfs@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: [PATCH 004 of 5] knfsd: Fix bug in recent lockd patches that can cause reclaim to fail.
Date: Tue, 17 Oct 2006 09:30:25 +1000	[thread overview]
Message-ID: <1061016233025.11354@suse.de> (raw)
In-Reply-To: 20061017092702.11224.patches@notabene


When an nfs server shuts down, lockd needs to release all the locks
even though the client still holds them.

It should therefore not 'unmonitor' the clients, so that the files in
nfs/sm will still be there when the nfs server restarts, so that those
clients will be told to reclaim their locks.

However the hosts are fully unmonitored, so statd may well remove the
files.

lockd has a test for 'sm_sticky' and avoid the unmonitor call if it is
set, but it is currently not set.

So set it when tearing down lockd.

Signed-off-by: Neil Brown <neilb@suse.de>

### Diffstat output
 ./fs/lockd/svcsubs.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff .prev/fs/lockd/svcsubs.c ./fs/lockd/svcsubs.c
--- .prev/fs/lockd/svcsubs.c	2006-10-17 09:10:39.000000000 +1000
+++ ./fs/lockd/svcsubs.c	2006-10-17 09:10:40.000000000 +1000
@@ -324,7 +324,17 @@ nlmsvc_same_host(struct nlm_host *host, 
 static int
 nlmsvc_is_client(struct nlm_host *host, struct nlm_host *dummy)
 {
-	return host->h_server;
+	if (host->h_server)
+	{
+		/* we are destroying locks even though the client
+		 * hasn't asked us too, so don't unmonitor the
+		 * client
+		 */
+		if (host->h_nsmhandle)
+			host->h_nsmhandle->sm_sticky = 1;
+		return 1;
+	} else
+		return 0;
 }
 
 /*

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

WARNING: multiple messages have this Message-ID (diff)
From: NeilBrown <neilb@suse.de>
To: Andrew Morton <akpm@osdl.org>
Cc: nfs@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: [PATCH 004 of 5] knfsd: Fix bug in recent lockd patches that can cause reclaim to fail.
Date: Tue, 17 Oct 2006 09:30:25 +1000	[thread overview]
Message-ID: <1061016233025.11354@suse.de> (raw)
In-Reply-To: 20061017092702.11224.patches@notabene


When an nfs server shuts down, lockd needs to release all the locks
even though the client still holds them.

It should therefore not 'unmonitor' the clients, so that the files in
nfs/sm will still be there when the nfs server restarts, so that those
clients will be told to reclaim their locks.

However the hosts are fully unmonitored, so statd may well remove the
files.

lockd has a test for 'sm_sticky' and avoid the unmonitor call if it is
set, but it is currently not set.

So set it when tearing down lockd.

Signed-off-by: Neil Brown <neilb@suse.de>

### Diffstat output
 ./fs/lockd/svcsubs.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff .prev/fs/lockd/svcsubs.c ./fs/lockd/svcsubs.c
--- .prev/fs/lockd/svcsubs.c	2006-10-17 09:10:39.000000000 +1000
+++ ./fs/lockd/svcsubs.c	2006-10-17 09:10:40.000000000 +1000
@@ -324,7 +324,17 @@ nlmsvc_same_host(struct nlm_host *host, 
 static int
 nlmsvc_is_client(struct nlm_host *host, struct nlm_host *dummy)
 {
-	return host->h_server;
+	if (host->h_server)
+	{
+		/* we are destroying locks even though the client
+		 * hasn't asked us too, so don't unmonitor the
+		 * client
+		 */
+		if (host->h_nsmhandle)
+			host->h_nsmhandle->sm_sticky = 1;
+		return 1;
+	} else
+		return 0;
 }
 
 /*

  parent reply	other threads:[~2006-10-16 23:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-16 23:30 [PATCH 000 of 5] knfsd: Introduction - bugfixes for 2.6.19 NeilBrown
2006-10-16 23:30 ` NeilBrown
2006-10-16 23:30 ` [PATCH 001 of 5] knfsd: nfsd4: fix owner-override on open NeilBrown
2006-10-16 23:30   ` NeilBrown
2006-10-16 23:30 ` [PATCH 002 of 5] knfsd: nfsd4: fix open permission checking NeilBrown
2006-10-16 23:30   ` NeilBrown
2006-10-16 23:30 ` [PATCH 003 of 5] knfsd: nfsd4: Fix error handling in nfsd's callback client NeilBrown
2006-10-16 23:30   ` NeilBrown
2006-10-16 23:30 ` NeilBrown [this message]
2006-10-16 23:30   ` [PATCH 004 of 5] knfsd: Fix bug in recent lockd patches that can cause reclaim to fail NeilBrown
2006-10-16 23:30 ` [PATCH 005 of 5] knfsd: Allow lockd to drop replys as appropriate NeilBrown
2006-10-16 23:30   ` NeilBrown

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=1061016233025.11354@suse.de \
    --to=neilb@suse.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nfs@lists.sourceforge.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.