git://git.openafs.org
/
openafs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
645f7e8
)
lock-mask-64bit-negative-1-for-java-20070212
author
Adam Megacz
<megacz@cs.berkeley.edu>
Tue, 13 Feb 2007 01:33:20 +0000 (
01:33
+0000)
committer
Derrick Brashear
<shadow@dementia.org>
Tue, 13 Feb 2007 01:33:20 +0000 (
01:33
+0000)
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
patch
|
blob
|
history
diff --git
a/src/afs/VNOPS/afs_vnop_flock.c
b/src/afs/VNOPS/afs_vnop_flock.c
index
6d1ded9
..
6b3b30c
100644
(file)
--- 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) {