From 99e704c791bbedd9aa3fc1a0feb9493b0eaefd7d Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sat, 20 Feb 2010 20:52:06 -0500 Subject: [PATCH] Adjust afs_lockctl to compensate for byte-range lock fixes 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 Change-Id: I3fb7665457d489e56564b14933795084a0958d6f Reviewed-on: http://gerrit.openafs.org/1353 Reviewed-by: Simon Wilkinson Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/afs/VNOPS/afs_vnop_flock.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/afs/VNOPS/afs_vnop_flock.c b/src/afs/VNOPS/afs_vnop_flock.c index 7143181c8..97fb4613f 100644 --- a/src/afs/VNOPS/afs_vnop_flock.c +++ b/src/afs/VNOPS/afs_vnop_flock.c @@ -563,24 +563,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 == 0x7ffffffffffffffeLL)) + /* 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 */ -- 2.39.5