Cache bypass: Fix oops in bypass transition functions
authorMarc Dionne <marc.c.dionne@gmail.com>
Fri, 5 Nov 2010 00:49:41 +0000 (20:49 -0400)
committerDerrick Brashear <shadow@dementia.org>
Fri, 5 Nov 2010 02:53:53 +0000 (19:53 -0700)
commitf2c6ae300a211460c24c87752cf9400b9e61ee1f
tree8148dd6daaa49dbeb9bcb982fdfe28590fd2768d
parent732a4c52d5e4836d8219dd03c2e9e17e89e395a5
Cache bypass: Fix oops in bypass transition functions

The FCSBypass flag might change between the time we check it before
entering afs_TransitionToCaching or afs_TransitionToBypass and when
we check it again within the functions.

Instead of panicing, just exit if someone beat us to it.  Also move
the checks within the write lock region to make sure the code
doesn't get run multiple times.

Change-Id: I4319896e522d0681c548299d2bd547e71998cc88
Reviewed-on: http://gerrit.openafs.org/3266
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/afs/afs_bypasscache.c