Linux: cache bypass: fix FCSBypass tests
authorMarc Dionne <marc.c.dionne@gmail.com>
Fri, 2 Jul 2010 13:13:50 +0000 (09:13 -0400)
committerDerrick Brashear <shadow@dementia.org>
Fri, 2 Jul 2010 17:03:36 +0000 (10:03 -0700)
Add some parentheses around the tests for FCSBypass.
Without them, the test will not always give the intended result.

Change-Id: I94cb2b2c95c702981fce9cff066b620bce652ee1
Reviewed-on: http://gerrit.openafs.org/2324
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/afs/afs_bypasscache.c

index 2d09566..dbda01b 100644 (file)
@@ -159,7 +159,7 @@ afs_TransitionToBypass(register struct vcache *avc,
     ObtainWriteLock(&avc->lock, 925);
        
     /* If we never cached this, just change state */
-    if (setDesire && (!avc->cachingStates & FCSBypass)) {
+    if (setDesire && (!(avc->cachingStates & FCSBypass))) {
        avc->f.states |= FCSBypass;
        goto done;
     }
@@ -220,7 +220,7 @@ afs_TransitionToCaching(register struct vcache *avc,
     if (!avc)
        return;
 
-    if (!avc->f.states & FCSBypass)
+    if (!(avc->f.states & FCSBypass))
        osi_Panic("afs_TransitionToCaching: illegal transition to caching--already caching\n");         
                
     if (aflags & TRANSChangeDesiredBit)