diff --git a/src/afs/VNOPS/afs_vnop_flock.c b/src/afs/VNOPS/afs_vnop_flock.c index e2eaf8ac67..af942f18fc 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) {