OpenAFS Master Repository branch, openafs-devel-1_7_x, updated. openafs-devel-1_7_21-128-g3eb9fe1

Gerrit Code Review gerrit@openafs.org
Mon, 11 Mar 2013 10:52:59 -0700 (PDT)


The following commit has been merged in the openafs-devel-1_7_x branch:
commit 725e403173c2f5f94166f69337e17b70d26db720
Author: Jeffrey Altman <jaltman@your-file-system.com>
Date:   Tue Mar 5 07:52:37 2013 -0500

    Windows: Avoid race during cm_FreeServerList
    
    cm_FreeServerList obtains cm_serverLock exclusively and in some
    circumstances will call cm_FreeServer().   cm_FreeServer() will
    drop the cm_serverLock if the cm_server_t.refCount is zero in order to
    avoid a lock order violation when calling cm_GCConnections() since
    cm_connLock is higher in the lock hierarchy.
    
    The call to cm_FreeServer is performed after the cm_serverRef_t
    to be deleted is identified but before it is removed from the list.
    There is the potential for two threads calling cm_FreeServerList()
    to race and for more than one thread to attempt to delete the same
    cm_serverRef_t twice.
    
    Fix this by:
    
    1. maintain a private copy of the cm_server_t pointer, delete the
    cm_serverRef_t and update the list pointers before calling cm_FreeServer().
    
    2. obtain and release a refcnt on the next cm_serverRef_t to ensure
    that it is not deleted out from underneath the thread in case the
    cm_serverLock is dropped.
    
    Reviewed-on: http://gerrit.openafs.org/9391
    Tested-by: BuildBot <buildbot@rampaginggeek.com>
    Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
    (cherry picked from commit 1b048f1f571eb02976a78a4dabafb3c677fbf9d0)
    
    Change-Id: I0ee55f76f1af181bc8c3d2ea79aeb76e9f7fa8f6
    Reviewed-on: http://gerrit.openafs.org/9556
    Tested-by: BuildBot <buildbot@rampaginggeek.com>
    Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

 src/WINNT/afsd/cm_server.c |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

-- 
OpenAFS Master Repository