aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2006-10-17 03:10:17 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-17 11:18:46 -0400
commit4481d1038f4116f3f5c307d919e6dc815a3acbb9 (patch)
tree4424568a3b335a379796eb867e3c0d898b2dc5d3 /fs/lockd
parent0942176f4353ffebcd6e3f95abce9fd8e24f2cb1 (diff)
[PATCH] knfsd: Fix bug in recent lockd patches that can cause reclaim to fail
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> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/lockd')
-rw-r--r--fs/lockd/svcsubs.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/lockd/svcsubs.c b/fs/lockd/svcsubs.c
index 514f5f20701e..c5f9113cdc70 100644
--- a/fs/lockd/svcsubs.c
+++ b/fs/lockd/svcsubs.c
@@ -324,7 +324,16 @@ nlmsvc_same_host(struct nlm_host *host, struct nlm_host *other)
324static int 324static int
325nlmsvc_is_client(struct nlm_host *host, struct nlm_host *dummy) 325nlmsvc_is_client(struct nlm_host *host, struct nlm_host *dummy)
326{ 326{
327 return host->h_server; 327 if (host->h_server) {
328 /* we are destroying locks even though the client
329 * hasn't asked us too, so don't unmonitor the
330 * client
331 */
332 if (host->h_nsmhandle)
333 host->h_nsmhandle->sm_sticky = 1;
334 return 1;
335 } else
336 return 0;
328} 337}
329 338
330/* 339/*