Fix lockd oops caused by f_count
Subsystems (2)
PATCH 1/1 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.
svcsubs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/lockd/svcsubs.c +1 -2
@@ -250,8 +250,7 @@ nlm_traverse_files(struct nlm_host *hostmutex_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