On 11 Aug 2010, at 16:14, Hans-Werner Paulsen wrote:

> time 961.188544, pid 5152: Analyze RPC op 13 conn 0xffffffffc53572c0 code 0x0 
> user 0x41629d76 
This is a SetLock

> time 961.188660, pid 5152: Analyze RPC op 15 conn 0xffffffffc53572c0 code 0x0 
> user 0x41629d76 
This is a ReleaseLock

That sequence of actions means that it's afs_posix_lock_file() that is failing 
- that's just a compatibility wrapper around Linux's posix_lock_file function, 
which we use to enrol our looks in the kernel lock management scheme. However, 
when posix_lock_file fails it returns a kernel form (negative) error code - not 
a positive AFS error code, and so afs_convert_code mangles it.

The fix for the first part is (apologies for any patch fuzz):

diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
index 4beed54..a280d0e 100644
--- a/src/afs/LINUX/osi_vnodeops.c
+++ b/src/afs/LINUX/osi_vnodeops.c
@@ -480,7 +480,7 @@ afs_linux_lock(struct file *fp, int cmd, struct file_lock *f
 #endif /* F_GETLK64 && F_GETLK != F_GETLK64 */
 
     AFS_GLOCK();
-    code = afs_lockctl(vcp, &flock, cmd, credp);
+    code = afs_convert_code(afs_lockctl(vcp, &flock, cmd, credp));
     AFS_GUNLOCK();
 
     if ((code == 0 || flp->fl_type == F_UNLCK) && 
@@ -517,7 +517,7 @@ afs_linux_lock(struct file *fp, int cmd, struct file_lock *f
        flp->fl_end = flock.l_start + flock.l_len - 1;
 
     crfree(credp);
-    return afs_convert_code(code);
+    return code;
 }
 
 #ifdef STRUCT_FILE_OPERATIONS_HAS_FLOCK

Once you've applied this, I would be interested to know what error your test 
now returns ...

Cheers,

Simon.

_______________________________________________
OpenAFS-devel mailing list
[email protected]
https://lists.openafs.org/mailman/listinfo/openafs-devel

Reply via email to