Windows: cm_ConnByServer fix search for replication

Separate connection objects are maintained for use when accessing
replicated and single source volumes.   If the matching connection
type cannot be found while holding the cm_connLock shared a second
search is performed after the lock is upgraded to an exclusive lock.
This second connection search was not enforcing the replication criteria.

Change-Id: I408a5d87c3a82da5235fa2255db7d1d7a6bcb6d9
Reviewed-on: http://gerrit.openafs.org/10681
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
This commit is contained in:
Jeffrey Altman 2014-01-07 10:57:01 -05:00
parent cccb5e6142
commit 6995a56884

View File

@ -1669,7 +1669,9 @@ long cm_ConnByServer(cm_server_t *serverp, cm_user_t *userp, afs_uint32 replicat
if (!tcp) { if (!tcp) {
lock_ConvertRToW(&cm_connLock); lock_ConvertRToW(&cm_connLock);
for (tcp = serverp->connsp; tcp; tcp=tcp->nextp) { for (tcp = serverp->connsp; tcp; tcp=tcp->nextp) {
if (tcp->userp == userp) if (tcp->userp == userp &&
(replicated && (tcp->flags & CM_CONN_FLAG_REPLICATION) ||
!replicated && !(tcp->flags & CM_CONN_FLAG_REPLICATION)))
break; break;
} }
if (tcp) { if (tcp) {