OpenAFS Master Repository branch, openafs-stable-1_6_x, updated. openafs-stable-1_6_1pre2-62-g25b96ac

Gerrit Code Review gerrit@openafs.org
Sun, 26 Feb 2012 07:06:45 -0800 (PST)


The following commit has been merged in the openafs-stable-1_6_x branch:
commit 25b96acb42b197de32f8d02aeb3526fe0517ebad
Author: Jeffrey Altman <jaltman@your-file-system.com>
Date:   Thu Jan 19 15:25:44 2012 -0500

    Windows: cm_buf refcnt must hold buf_globalLock
    
    An assertion in buf_Recycle() was being triggered when a cm_buf_t
    object was supposed to be in the free buffer list but wasn't.
    buf_Recycle() was racing with another thread.  The test for
    refCount == 0 was performed while holding the buf_globalLock
    exclusively but the InterlockedDecrement(refCount) in buf_Release()
    was performed without holding buf_globalLock at all.  buf_globalLOck
    must be held at least as a read lock.  Otherwise, the refCount can
    reach 0 prior to the thread blocking for exclusive access to the
    buf_globalLock.  This provides buf_Recycle() which is holding
    buf_globalLock the opportunity to race.
    
    The solution is to make sure that buf_Release() always holds
    buf_globalLock as a read lock and then use buf_ReleaseLocked()
    to perform the actual decrement and test.
    
    Reviewed-on: http://gerrit.openafs.org/6576
    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 22cba8e9702f3673c335bf834a9ee2c5e5fd9b6e)
    
    Change-Id: I82c6480859a85e00e8602421204dac9a9ce588ed
    Reviewed-on: http://gerrit.openafs.org/6823
    Tested-by: BuildBot <buildbot@rampaginggeek.com>
    Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
    Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

 src/WINNT/afsd/cm_buf.c |   30 +++---------------------------
 1 files changed, 3 insertions(+), 27 deletions(-)

-- 
OpenAFS Master Repository