This patch fixes kernel oopses in the NFS subsystem under Linux 2.4.18. They occur if NLM locking is used. The oopses don't seem to be triggered by most Linux clients, but problems have been seen with Digital Unix 4 clients and other proprietory unix systems. In the fault condition, things would initially appear to work fine and then after a seemingly random time an Oops similar to the following would occur. Unable to handle kernel paging request at virtual address 938e38a4 printing eip: d8911bf2 *pde = 00000000 Oops: 0002 via82cxxx_audio uart401 ac97_codec sound soundcore binfmt_misc autofs nfs nfsd CPU: 0 EIP: 0010:[] Not tainted EFLAGS: 00010212 EIP is at xdr_encode_netobj_R29c6f164 [sunrpc] 0x12 (2.4.18-3) eax: 306db20d ebx: d4e8306c ecx: d1d77070 edx: d4e83064 esi: d4e83008 edi: d4e83008 ebp: d1d77070 esp: d790fda8 ds: 0018 es: 0018 ss: 0018 Process lockd (pid: 667, stackpage=d790f000) Stack: d4e83008 d4e83008 d8922f7b d1d77070 d4e83064 d1d7701c c6a740c0 d4e8306c c6a740c0 d8923920 c6a74cc0 d890e879 c89d805c c4fc2280 d8923920 c6a74cc0 d8923934 d1d7705c d4e83008 c89d805c d89098e0 c89d805c d1d7705c d4e83008 Call Trace: [] nlm4_encode_testres [lockd] 0x8b [] nlm4clt_encode_testres [lockd] 0x0 [] rpcauth_marshcred [sunrpc] 0x49 [] nlm4clt_encode_testres [lockd] 0x0 [] nlm4clt_encode_testres [lockd] 0x14 [] call_encode [sunrpc] 0xd0 [] __rpc_execute [sunrpc] 0xa9 [] rpc_call_setup_R0816cf16 [sunrpc] 0x46 [] rpc_call_async_Rf292dde9 [sunrpc] 0x77 [] nlmsvc_async_call [lockd] 0x7a [] nlm4svc_callback_exit [lockd] 0x0 [] nlm4svc_callback [lockd] 0x73 [] nlm4svc_callback_exit [lockd] 0x0 [] nlm4svc_proc_test_msg [lockd] 0x44 [] posix_lock_file [kernel] 0x551 [] posix_lock_file [kernel] 0x551 [] skb_checksum [kernel] 0x4c [] nlm4_decode_lock [lockd] 0x47 [] nlm4_decode_lock [lockd] 0x5c [] nlm4svc_decode_testargs [lockd] 0x2f [] nlmsvc_procedures4 [lockd] 0xc0 [] svc_process_Re3483a09 [sunrpc] 0x2c6 [] nlmsvc_version4 [lockd] 0x0 [] nlmsvc_program [lockd] 0x0 [] lockd [lockd] 0x19d [] kernel_thread [kernel] 0x26 [] lockd [lockd] 0x0 Code: c7 04 81 00 00 00 00 8b 4c 24 0c 83 44 24 0c 04 8b 02 0f c8 The patch follows. diff -u --recursive --new-file linux-2.4.18/fs/lockd/svc4proc.c linux-2.4.18-fix_lock/fs/lockd/svc4proc.c --- linux-2.4.18/fs/lockd/svc4proc.c Mon Oct 1 22:45:47 2001 +++ linux-2.4.18-fix_lock/fs/lockd/svc4proc.c Tue Apr 23 11:00:59 2002 @@ -254,6 +254,7 @@ dprintk("lockd: TEST_MSG called\n"); + memset(&res, 0, sizeof(res)); if ((stat = nlm4svc_proc_test(rqstp, argp, &res)) == 0) stat = nlm4svc_callback(rqstp, NLMPROC_TEST_RES, &res); return stat; diff -u --recursive --new-file linux-2.4.18/fs/lockd/svcproc.c linux-2.4.18-fix_lock/fs/lockd/svcproc.c --- linux-2.4.18/fs/lockd/svcproc.c Thu Oct 11 16:52:18 2001 +++ linux-2.4.18-fix_lock/fs/lockd/svcproc.c Tue Apr 23 11:01:10 2002 @@ -282,6 +282,7 @@ dprintk("lockd: TEST_MSG called\n"); + memset(&res, 0, sizeof(res)); if ((stat = nlmsvc_proc_test(rqstp, argp, &res)) == 0) stat = nlmsvc_callback(rqstp, NLMPROC_TEST_RES, &res); return stat;