[lkml]   [1998]   [Aug]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: NFS file locking broken (take 2)
> Alan asked:
> > Let me check one thing here. Are you using lockf/posix locks or flock.
> > flock is generally host local.
> I went back to square one and rebuilt kernels on both machines using
> 2.1.117 with ac1 + hj's patches from the 8/20 knfsd utils package.
> I used the attached C program to ensure that fcntl() semantics were being
> applied. After verifying that the test script worked properly on local
> storage, I tried running it on an NFS mounted directory.
> Here's what transpires (100% repeatable):

lockd is a mess. This patch seems to fix your problem. But I suspect
there may be more bugs in lockd. If you can show me a testcase, I will
take a look at it.


Index: fs/lockd/clntproc.c
RCS file: /home/work/cvs/linux/linux/fs/lockd/clntproc.c,v
retrieving revision
diff -u -p -r1.1.1.5 clntproc.c
--- fs/lockd/clntproc.c 1998/01/09 17:55:38
+++ fs/lockd/clntproc.c 1998/08/24 02:52:09
@@ -78,7 +78,9 @@ nlmclnt_setgrantargs(struct nlm_rqst *ca
nlmclnt_freegrantargs(struct nlm_rqst *call)
- kfree(call->a_args.lock.caller);
+ struct nlm_lock *lock = &call->a_args.lock;
+ if (lock->oh.len > NLMCLNT_OHSIZE)
+ kfree(lock->;

Index: fs/lockd/svcproc.c
RCS file: /home/work/cvs/linux/linux/fs/lockd/svcproc.c,v
retrieving revision
diff -u -p -r1.1.1.2 svcproc.c
--- fs/lockd/svcproc.c 1998/03/07 20:03:34
+++ fs/lockd/svcproc.c 1998/08/24 02:52:09
@@ -499,15 +499,22 @@ nlmsvc_callback_exit(struct rpc_task *ta
* NLM Server procedures.
-#define nlmsvc_proc_none NULL
-#define nlmsvc_encode_norep NULL
-#define nlmsvc_decode_norep NULL
-#define nlmsvc_decode_testres NULL
-#define nlmsvc_proc_test_res NULL
-#define nlmsvc_proc_lock_res NULL
-#define nlmsvc_proc_cancel_res NULL
-#define nlmsvc_proc_unlock_res NULL
-#define nlmsvc_proc_granted_res NULL
+#define nlmsvc_encode_norep nlmsvc_encode_void
+#define nlmsvc_decode_norep nlmsvc_decode_void
+#define nlmsvc_decode_testres nlmsvc_decode_void
+#define nlmsvc_decode_lockres nlmsvc_decode_void
+#define nlmsvc_decode_unlockres nlmsvc_decode_void
+#define nlmsvc_decode_cancelres nlmsvc_decode_void
+#define nlmsvc_decode_grantedres nlmsvc_decode_void
+#define nlmsvc_proc_none nlmsvc_proc_null
+#define nlmsvc_proc_test_res nlmsvc_proc_null
+#define nlmsvc_proc_lock_res nlmsvc_proc_null
+#define nlmsvc_proc_cancel_res nlmsvc_proc_null
+#define nlmsvc_proc_unlock_res nlmsvc_proc_null
+#define nlmsvc_proc_granted_res nlmsvc_proc_null
struct nlm_void { int dummy; };

#define PROC(name, xargt, xrest, argt, rest) \
@@ -533,10 +540,10 @@ struct svc_procedure nlmsvc_procedures[
PROC(unlock_msg, unlockargs, norep, args, void),
PROC(granted_msg, testargs, norep, args, void),
PROC(test_res, testres, norep, res, void),
- PROC(lock_res, res, norep, res, void),
- PROC(cancel_res, res, norep, res, void),
- PROC(unlock_res, res, norep, res, void),
- PROC(granted_res, res, norep, res, void),
+ PROC(lock_res, lockres, norep, res, void),
+ PROC(cancel_res, cancelres, norep, res, void),
+ PROC(unlock_res, unlockres, norep, res, void),
+ PROC(granted_res, grantedres, norep, res, void),
PROC(none, void, void, void, void),
PROC(none, void, void, void, void),
PROC(none, void, void, void, void),
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:44    [W:0.079 / U:3.196 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site