Incrementing the cm_conn.refCount must be performed while holding
the cm_connLock in order to prevent cm_GCConnections() from
seeing an in-use object as having a zero count.
Change-Id: Ifaa755ef0f04f3bf64223434dfc518bc73d01d4d
Reviewed-on: http://gerrit.openafs.org/8347
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
break;
}
if (tcp) {
+ InterlockedIncrement(&tcp->refCount);
lock_ReleaseWrite(&cm_connLock);
goto haveconn;
}
lock_ReleaseWrite(&cm_connLock);
lock_ReleaseMutex(&userp->mx);
} else {
+ InterlockedIncrement(&tcp->refCount);
lock_ReleaseRead(&cm_connLock);
haveconn:
lock_ReleaseMutex(&userp->mx);
- InterlockedIncrement(&tcp->refCount);
lock_ObtainMutex(&tcp->mx);
if ((tcp->flags & CM_CONN_FLAG_FORCE_NEW) ||