From: Pavel Semerad Date: Thu, 15 Mar 2001 17:47:45 +0000 (+0000) Subject: fix-locking-on-linux-sparc64-20010312 X-Git-Tag: BP-openafs-devel-autoconf~31 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=4d3b445cc3e20feeb65c2915a80640a980b97608;p=packages%2Fo%2Fopenafs.git fix-locking-on-linux-sparc64-20010312 " 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) {