]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Adjust afs_lockctl to compensate for byte-range lock fixes
authorAnders Kaseorg <andersk@mit.edu>
Sun, 21 Feb 2010 01:52:06 +0000 (20:52 -0500)
committerRuss Allbery <rra@debian.org>
Tue, 4 May 2010 21:32:52 +0000 (14:32 -0700)
As of commit 49b7bbdd3b45df694fadbef48f9ed99d9bfe07b9, l_len is no
longer 1 less than it should be.  Update afs_lockctl to expect this.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Change-Id: I3fb7665457d489e56564b14933795084a0958d6f
Reviewed-on: http://gerrit.openafs.org/1353
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 99e704c791bbedd9aa3fc1a0feb9493b0eaefd7d)
Reviewed-on: http://gerrit.openafs.org/1373
(cherry picked from commit 89193695da6dc8946e4a03ed40081a91050ca5dc)

src/afs/VNOPS/afs_vnop_flock.c

index f3d33e7a1c4359ac5edbca8b5b0cbcc248d57a91..f569b87a6e051b72e0a52e46f7588617639b877d 100644 (file)
@@ -539,24 +539,8 @@ int afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd,
 #else
        ) {
 #endif
-    /* this next check is safer when left out, but more applications work
-     * with it in.  However, they fail in race conditions.  The question is
-     * what to do for people who don't have source to their application;
-     * this way at least, they can get work done */
-#ifdef AFS_LINUX24_ENV
-    if (af->l_len == OFFSET_MAX)
-       af->l_len = 0;          /* since some systems indicate it as EOF */
-#else
-    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
-#endif
-    /* Java VMs ask for l_len=(long)-1 regardless of OS/CPU; bottom 32 bits
-     * sometimes get masked off by OS */
-    if ((sizeof(af->l_len) == 8) && (af->l_len == 0x7ffffffffffffffe))
+    /* Java VMs ask for l_len=(long)-1 regardless of OS/CPU */
+    if ((sizeof(af->l_len) == 8) && (af->l_len == 0x7fffffffffffffffLL))
        af->l_len = 0;
     /* next line makes byte range locks always succeed,
      * even when they should block */