From: Jeffrey Altman Date: Tue, 7 Jan 2014 15:57:01 +0000 (-0500) Subject: Windows: cm_ConnByServer fix search for replication X-Git-Tag: openafs-stable-1_8_0pre1~859 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=6995a56884f31974e9b5a7c0c50e9c1aa0351a45 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 Reviewed-by: Jeffrey Altman --- diff --git a/src/WINNT/afsd/cm_conn.c b/src/WINNT/afsd/cm_conn.c index 4f0ce22..8975023 100644 --- a/src/WINNT/afsd/cm_conn.c +++ b/src/WINNT/afsd/cm_conn.c @@ -1669,8 +1669,10 @@ long cm_ConnByServer(cm_server_t *serverp, cm_user_t *userp, afs_uint32 replicat if (!tcp) { lock_ConvertRToW(&cm_connLock); for (tcp = serverp->connsp; tcp; tcp=tcp->nextp) { - if (tcp->userp == userp) - break; + if (tcp->userp == userp && + (replicated && (tcp->flags & CM_CONN_FLAG_REPLICATION) || + !replicated && !(tcp->flags & CM_CONN_FLAG_REPLICATION))) + break; } if (tcp) { InterlockedIncrement(&tcp->refCount);