From 01882246c8704e9cfad38e8bce71380b843fbbab Mon Sep 17 00:00:00 2001 From: Adam Megacz Date: Tue, 13 Feb 2007 01:33:20 +0000 Subject: [PATCH] lock-mask-64bit-negative-1-for-java-20070212 java sends a 64 bit long -1... which isn't going to be useful most of the time --- src/afs/VNOPS/afs_vnop_flock.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/afs/VNOPS/afs_vnop_flock.c b/src/afs/VNOPS/afs_vnop_flock.c index 6d1ded9778..6b3b30ce94 100644 --- a/src/afs/VNOPS/afs_vnop_flock.c +++ b/src/afs/VNOPS/afs_vnop_flock.c @@ -547,6 +547,10 @@ int afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd, af->l_len = 0; /* since some systems indicate it as EOF */ #endif #endif + /* Java VMs ask for l_len=(long)-1 regardless of OS/CPU; bottom 32 bits + * sometimes get masked off by OS */ + if ((af->l_len >> 32) == 0x7fffffff) + af->l_len = 0; /* next line makes byte range locks always succeed, * even when they should block */ if (af->l_whence != 0 || af->l_start != 0 || af->l_len != 0) {