From: Pavel Semerad Date: Mon, 23 Apr 2001 04:16:33 +0000 (+0000) Subject: STABLE10-fix-locking-on-linux-sparc64-20010422 X-Git-Tag: openafs-stable-1_0_4~100 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=b125a6599ee9170b3395103eaf1fb5264c708b40;p=packages%2Fo%2Fopenafs.git STABLE10-fix-locking-on-linux-sparc64-20010422 " I have found problem with file locking and 64bit linux (tested on ultrasparc). When issued fcntl(fd, f_SETLK, ..) with l_start = 0 and l_len = 0, it sets l_len to LONG_MAX, so it is needed to test this value" --- diff --git a/src/afs/VNOPS/afs_vnop_flock.c b/src/afs/VNOPS/afs_vnop_flock.c index 518186300..116cd08b4 100644 --- a/src/afs/VNOPS/afs_vnop_flock.c +++ b/src/afs/VNOPS/afs_vnop_flock.c @@ -536,6 +536,10 @@ struct AFS_UCRED *acred; { this way at least, they can get work done */ if (af->l_len == 0x7fffffff) af->l_len = 0; /* since some systems indicate it as EOF */ +#ifdef AFS_LINUX_64BIT_KERNEL + if (af->l_len == LONG_MAX) + af->l_len = 0; /* since some systems indicate it as EOF */ +#endif /* 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) {