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>
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);