STABLE14-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


(cherry picked from commit 01882246c8)
This commit is contained in:
Adam Megacz 2007-02-13 01:36:11 +00:00 committed by Derrick Brashear
parent a2aec66832
commit d1aa0fc9dd

View File

@ -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) {