OpenAFS Master Repository branch, openafs-devel-1_7_x, updated. openafs-devel-1_7_1-179-ge699ac3

Gerrit Code Review gerrit@openafs.org
Sat, 12 Nov 2011 19:50:25 -0800 (PST)


The following commit has been merged in the openafs-devel-1_7_x branch:
commit e699ac3fa840fdcc2e31060fdcb91924708ce946
Author: Jeffrey Altman <jaltman@your-file-system.com>
Date:   Sat Nov 12 17:32:06 2011 -0500

    Windows: cm_GetSCache avoid holding cm_scacheLock
    
    cm_GetSCache used to hold cm_scacheLock write-locked from
    start to finish except that it didn't.  There were several
    places where cm_scacheLock was dropped and reacquired due
    to lock ordering requirements.  Unfortunately, this has
    two problems. First, the function isn't very fast in the
    most common case since cm_scacheLock is write-locked for
    the search for an existing FID.  Second, there is a race
    that results when cm_GetNewSCache() drops the cm_scacheLock.
    
    To make things faster, use a read-lock for the common case.
    
    To avoid the race, if the FID cannot be located, call
    cm_GetNewSCache() first and then obtain the cell and volume
    information.  Then perform a second lookup for the FID while
    holding cm_scacheLock write-locked.  If we lost the race or
    there was an error obtaining the cell and volume info, put
    the new cm_scache_t back onto the end of the LRU queue.
    
    Reviewed-on: http://gerrit.openafs.org/6003
    Tested-by: BuildBot <buildbot@rampaginggeek.com>
    Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
    Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
    (cherry picked from commit 5c59d1b500ae4ba5223184fbfe18837891ea30c3)
    
    Change-Id: Ifcaf015b4105487fa3de123636f1d9aacbbb482a
    Reviewed-on: http://gerrit.openafs.org/6014
    Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
    Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

 src/WINNT/afsd/cm_scache.c |  119 +++++++++++++++++++++++++++++---------------
 src/WINNT/afsd/cm_scache.h |    2 +-
 2 files changed, 79 insertions(+), 42 deletions(-)

-- 
OpenAFS Master Repository