From 4d3b445cc3e20feeb65c2915a80640a980b97608 Mon Sep 17 00:00:00 2001 From: Pavel Semerad Date: Thu, 15 Mar 2001 17:47:45 +0000 Subject: [PATCH] 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" --- src/afs/VNOPS/afs_vnop_flock.c | 4 ++++ 1 file changed, 4 insertions(+) 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) { -- 2.39.5