2007-04-18 15:30:26

by Wendy Cheng

[permalink] [raw]
Subject: [PATCH] Fix lockd oops caused by f_count

Code segment breaks out of the original NLM failover patch set since it
is a bug fix for current lockd (server) code.

When posix locks are still held by NLM clients, lockd server side could
oops if nlm_traverse_files() is invoked. The code falsely relies on
f_count to identify whether the file lock is in-use. The f_count can be
zero as soon as NLM server RPC call is returned while client is having
the lock.

Signed-off-by: S. Wendy Cheng <[email protected]>

svcsubs.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

--- gfs2-nmw/fs/lockd/svcsubs.c 2007-04-10 11:59:09.000000000 -0400
+++ linux/fs/lockd/svcsubs.c 2007-04-18 10:01:23.000000000 -0400
@@ -250,8 +250,7 @@ nlm_traverse_files(struct nlm_host *host
mutex_lock(&nlm_file_mutex);
file->f_count--;
/* No more references to this file. Let go of it. */
- if (list_empty(&file->f_blocks) && !file->f_locks
- && !file->f_shares && !file->f_count) {
+ if (!nlm_file_inuse(file)) {
hlist_del(&file->f_list);
nlmsvc_ops->fclose(file->f_file);
kfree(file);



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs