92d36af94829a6106b9f9e8cf27e1c714eecca10
[openafs.git] / src / afs / afs_conn.c
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  *
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 /*
11  * Implements:
12  */
13 #include <afsconfig.h>
14 #include "afs/param.h"
15
16
17 #include "afs/stds.h"
18 #include "afs/sysincludes.h"    /* Standard vendor system headers */
19
20 #if !defined(UKERNEL)
21 #if !defined(AFS_LINUX20_ENV)
22 #include <net/if.h>
23 #endif
24 #include <netinet/in.h>
25
26 #ifdef AFS_SGI62_ENV
27 #include "h/hashing.h"
28 #endif
29 #if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV)
30 #include <netinet/in_var.h>
31 #endif /* ! AFS_HPUX110_ENV */
32 #endif /* !defined(UKERNEL) */
33
34 #include "afsincludes.h"        /* Afs-based standard headers */
35 #include "afs/afs_stats.h"      /* afs statistics */
36
37 #if     defined(AFS_SUN5_ENV)
38 #include <inet/led.h>
39 #include <inet/common.h>
40 #include <netinet/ip6.h>
41 #include <inet/ip.h>
42 #endif
43
44 /* Exported variables */
45 afs_rwlock_t afs_xconn;         /* allocation lock for new things */
46 afs_rwlock_t afs_xinterface;    /* for multiple client address */
47 afs_int32 cryptall = 1;         /* encrypt all communications */
48
49 /* some connection macros */
50
51 /* a constructor */
52 #define new_conn_vector(xcv) \
53 do { \
54         xcv = (struct sa_conn_vector *) \
55         afs_osi_Alloc(sizeof(struct sa_conn_vector)); \
56         if (xcv) { \
57                 memset((char *)xcv, 0, sizeof(struct sa_conn_vector)); \
58         } \
59 } while (0);
60
61 /* select a connection to return (if no connection has lower utilization
62  * than any other) */
63 #define conn_vec_select_conn(xcv, bix, conn) \
64 do { \
65     (bix) = ((xcv)->select_index)++ % CVEC_LEN; \
66     (conn) = &((xcv)->cvec[bix]); \
67 } while (0);
68
69 #define struct_conn(s) ((struct afs_conn *)(s))
70
71 #define REPORT_CONNECTIONS_ISSUED 0 /* enable to see utilization */
72
73 /**
74  * Find a connection with call slots available, allocating one
75  * if nothing is available and we find an allocated slot
76  * @param xcv  A connection vector
77  * @param create  If set, a new connection may be created
78  */
79 static struct afs_conn *
80 find_preferred_connection(struct sa_conn_vector *xcv, int create)
81 {
82     afs_int32 cix, bix;
83     struct afs_conn *tc = NULL;
84
85     bix = -1;
86     for(cix = 0; cix < CVEC_LEN; ++cix) {
87         tc = &(xcv->cvec[cix]);
88         if (!tc->id) {
89             if (create) {
90                 tc->parent = xcv;
91                 tc->forceConnectFS = 1;
92                 tc->activated = 1;
93                 bix = cix;
94                 break;
95             } /* create */
96         } else {
97             if (tc->refCount < (RX_MAXCALLS-1)) {
98                 bix = cix;
99                 goto f_conn;
100             } else if (cix == (CVEC_LEN-1))
101                 conn_vec_select_conn(xcv, bix, tc);
102         } /* tc->id */
103     } /* for cix < CVEC_LEN */
104
105     if (bix < 0) {
106         tc = NULL;
107         goto out;
108     }
109
110 f_conn:
111     tc->refCount++;
112     xcv->refCount++;
113
114 #if REPORT_CONNECTIONS_ISSUED
115     afs_warn("Issuing conn %d refCount=%d parent refCount=%d\n", bix,
116              tc->refCount, xcv->refCount);
117 #endif
118
119 out:
120     return (tc);
121
122 }        /* find_preferred_connection */
123
124
125 /**
126  * Release all connections for unix user xu at server xs
127  * @param xu
128  * @param xs
129  */
130 static void
131 release_conns_user_server(struct unixuser *xu, struct server *xs)
132 {
133     int cix, glocked;
134     struct srvAddr *sa;
135     struct afs_conn *tc;
136     struct sa_conn_vector *tcv, **lcv, *tcvn;
137     for (sa = (xs)->addr; sa; sa = sa->next_sa) {
138         lcv = &sa->conns;
139         for (tcv = *lcv; tcv; lcv = &tcv->next, tcv = *lcv) {
140             if (tcv->user == (xu) && tcv->refCount == 0) {
141                 *lcv = tcv->next;
142                 /* our old friend, the GLOCK */
143                 glocked = ISAFS_GLOCK();
144                 if (glocked)
145                     AFS_GUNLOCK();
146                 for(cix = 0; cix < CVEC_LEN; ++cix) {
147                     tc = &(tcv->cvec[cix]);
148                     if (tc->activated) {
149                         rx_SetConnSecondsUntilNatPing(tc->id, 0);
150                         rx_DestroyConnection(tc->id);
151                         /* find another eligible connection */
152                         if (sa->natping == tc) {
153                             int cin;
154                             struct afs_conn *tcn;
155                             sa->natping = NULL;
156                             for (tcvn = sa->conns; tcvn; tcvn = tcvn->next) {
157                                 if (sa->natping != NULL)
158                                     break;
159                                 if (tcvn == tcv)
160                                     continue;
161                                 for(cin = 0; cin < CVEC_LEN; ++cin) {
162                                     tcn = &(tcvn->cvec[cin]);
163                                     if (tcn->activated) {
164                                         rx_SetConnSecondsUntilNatPing(tcn->id, 20);
165                                         sa->natping = tcn;
166                                         break;
167                                     }
168                                 }
169                             }
170                         }
171                     }
172                 }
173                 if (glocked)
174                     AFS_GLOCK();
175                 afs_osi_Free(tcv, sizeof(struct sa_conn_vector));
176                 break;    /* at most one instance per server */
177             } /*Found unreferenced connection for user */
178         }
179     } /*For each connection on the server */
180
181 }        /* release_conns_user_server */
182
183
184 static void
185 release_conns_vector(struct sa_conn_vector *tcv)
186 {
187     int cix, glocked;
188     struct afs_conn *tc;
189     struct sa_conn_vector *next;
190
191     while (tcv != NULL) {
192         next = tcv->next;
193
194         /* you know it, you love it, the GLOCK */
195         glocked = ISAFS_GLOCK();
196         if (glocked)
197             AFS_GUNLOCK(); \
198         for(cix = 0; cix < CVEC_LEN; ++cix) {
199             tc = &(tcv->cvec[cix]);
200             if (tc->activated) {
201                 rx_SetConnSecondsUntilNatPing(tc->id, 0);
202                 rx_DestroyConnection(tc->id);
203                 if (tcv->srvr->natping == tc)
204                     tcv->srvr->natping = NULL;
205             }
206         }
207         if (glocked)
208             AFS_GLOCK();
209         afs_osi_Free(tcv, sizeof(struct sa_conn_vector));
210         tcv = next;
211     }
212
213 }        /* release_conns_vector */
214
215
216 unsigned int VNOSERVERS = 0;
217
218 /**
219  * Pick a security object to use for a connection to a given server,
220  * by a given user
221  *
222  * @param[in] conn
223  *      The AFS connection for which the security object is required
224  * @param[out] secLevel
225  *      The security level of the returned object
226  *
227  * @return
228  *      An rx security object. This function is guaranteed to return
229  *      an object, although that object may be rxnull (with a secLevel
230  *      of 0)
231  */
232 static struct rx_securityClass *
233 afs_pickSecurityObject(struct afs_conn *conn, int *secLevel)
234 {
235     struct rx_securityClass *secObj = NULL;
236     union tokenUnion *token;
237
238     /* Do we have tokens ? */
239     if (conn->parent->user->states & UHasTokens) {
240         token = afs_FindToken(conn->parent->user->tokens, RX_SECIDX_KAD);
241         if (token) {
242             *secLevel = RX_SECIDX_KAD;
243             /* kerberos tickets on channel 2 */
244             secObj = rxkad_NewClientSecurityObject(
245                          cryptall ? rxkad_crypt : rxkad_clear,
246                          (struct ktc_encryptionKey *)
247                                token->rxkad.clearToken.HandShakeKey,
248                          token->rxkad.clearToken.AuthHandle,
249                          token->rxkad.ticketLen, token->rxkad.ticket);
250             /* We're going to use this token, so populate the viced */
251             conn->parent->user->viceId = token->rxkad.clearToken.ViceId;
252         }
253      }
254      if (secObj == NULL) {
255         *secLevel = 0;
256         secObj = rxnull_NewClientSecurityObject();
257      }
258
259      return secObj;
260 }
261
262
263 /**
264  * Try setting up a connection to the server containing the specified fid.
265  * Gets the volume, checks if it's up and does the connection by server address.
266  *
267  * @param afid
268  * @param areq Request filled in by the caller.
269  * @param locktype Type of lock that will be used.
270  *
271  * @return The conn struct, or NULL.
272  */
273 struct afs_conn *
274 afs_Conn(struct VenusFid *afid, struct vrequest *areq,
275          afs_int32 locktype, struct rx_connection **rxconn)
276 {
277     u_short fsport = AFS_FSPORT;
278     struct volume *tv;
279     struct afs_conn *tconn = NULL;
280     struct srvAddr *lowp = NULL;
281     struct unixuser *tu;
282     int notbusy;
283     int i;
284     struct srvAddr *sa1p;
285     afs_int32 replicated = -1; /* a single RO will increment to 0 */
286
287     *rxconn = NULL;
288
289     AFS_STATCNT(afs_Conn);
290     /* Get fid's volume. */
291     tv = afs_GetVolume(afid, areq, READ_LOCK);
292     if (!tv) {
293         if (areq) {
294             afs_FinalizeReq(areq);
295             areq->volumeError = 1;
296         }
297         return NULL;
298     }
299
300     if (tv->serverHost[0] && tv->serverHost[0]->cell) {
301         fsport = tv->serverHost[0]->cell->fsport;
302     } else {
303         VNOSERVERS++;
304     }
305
306     /* First is always lowest rank, if it's up */
307     if ((tv->status[0] == not_busy) && tv->serverHost[0]
308         && tv->serverHost[0]->addr
309         && !(tv->serverHost[0]->addr->sa_flags & SRVR_ISDOWN) &&
310         !(((areq->idleError > 0) || (areq->tokenError > 0))
311           && (areq->skipserver[0] == 1)))
312         lowp = tv->serverHost[0]->addr;
313
314     /* Otherwise we look at all of them. There are seven levels of
315      * not_busy. This means we will check a volume seven times before it
316      * is marked offline. Ideally, we only need two levels, but this
317      * serves a second purpose of waiting some number of seconds before
318      * the client decides the volume is offline (ie: a clone could finish
319      * in this time).
320      */
321     for (notbusy = not_busy; (!lowp && (notbusy <= end_not_busy)); notbusy++) {
322         for (i = 0; i < AFS_MAXHOSTS && tv->serverHost[i]; i++) {
323             if (tv->states & VRO)
324                 replicated++;
325             if (((areq->tokenError > 0)||(areq->idleError > 0))
326                 && (areq->skipserver[i] == 1))
327                 continue;
328             if (tv->status[i] != notbusy) {
329                 if (tv->status[i] == rd_busy || tv->status[i] == rdwr_busy) {
330                     if (!areq->busyCount)
331                         areq->busyCount++;
332                 } else if (tv->status[i] == offline) {
333                     if (!areq->volumeError)
334                         areq->volumeError = VOLMISSING;
335                 }
336                 continue;
337             }
338             for (sa1p = tv->serverHost[i]->addr; sa1p; sa1p = sa1p->next_sa) {
339                 if (sa1p->sa_flags & SRVR_ISDOWN)
340                     continue;
341                 if (!lowp || (lowp->sa_iprank > sa1p->sa_iprank))
342                     lowp = sa1p;
343             }
344         }
345     }
346     if ((replicated == -1) && (tv->states & VRO)) {
347         for (i = 0; i < AFS_MAXHOSTS && tv->serverHost[i]; i++) {
348             if (tv->states & VRO)
349                 replicated++;
350         }
351     } else
352         replicated = 0;
353
354     afs_PutVolume(tv, READ_LOCK);
355
356     if (lowp) {
357         tu = afs_GetUser(areq->uid, afid->Cell, SHARED_LOCK);
358         tconn = afs_ConnBySA(lowp, fsport, afid->Cell, tu, 0 /*!force */ ,
359                              1 /*create */ , locktype, replicated, rxconn);
360
361         afs_PutUser(tu, SHARED_LOCK);
362     }
363
364     return tconn;
365 }                               /*afs_Conn */
366
367
368 /**
369  * Connects to a server by it's server address.
370  *
371  * @param sap Server address.
372  * @param aport Server port.
373  * @param acell
374  * @param tu Connect as this user.
375  * @param force_if_down
376  * @param create
377  * @param replicated
378  * @param locktype Specifies type of lock to be used for this function.
379  *
380  * @return The new connection.
381  */
382 struct afs_conn *
383 afs_ConnBySA(struct srvAddr *sap, unsigned short aport, afs_int32 acell,
384              struct unixuser *tu, int force_if_down, afs_int32 create,
385              afs_int32 locktype, afs_int32 replicated,
386              struct rx_connection **rxconn)
387 {
388     int glocked, foundvec;
389     struct afs_conn *tc = NULL;
390     struct sa_conn_vector *tcv = NULL;
391     struct rx_securityClass *csec; /*Security class object */
392     int isec; /*Security index */
393     int service;
394     int isrep = (replicated > 0)?CONN_REPLICATED:0;
395
396     *rxconn = NULL;
397
398     if (!sap || ((sap->sa_flags & SRVR_ISDOWN) && !force_if_down)) {
399         /* sa is known down, and we don't want to force it.  */
400         return NULL;
401     }
402
403     /* find cached connection */
404     ObtainSharedLock(&afs_xconn, 15);
405     foundvec = 0;
406     for (tcv = sap->conns; tcv; tcv = tcv->next) {
407         if (tcv->user == tu && tcv->port == aport &&
408             (isrep == (tcv->flags & CONN_REPLICATED))) {
409             /* return most eligible conn */
410             if (!foundvec)
411                 foundvec = 1;
412             UpgradeSToWLock(&afs_xconn, 37);
413             tc = find_preferred_connection(tcv, create);
414             ConvertWToSLock(&afs_xconn);
415             break;
416         }
417     }
418
419     if (!tc && !create) {
420         /* Not found and can't create a new one. */
421         ReleaseSharedLock(&afs_xconn);
422         return NULL;
423     }
424
425     if (AFS_IS_DISCONNECTED && !AFS_IN_SYNC) {
426         afs_warnuser("afs_ConnBySA: disconnected\n");
427         ReleaseSharedLock(&afs_xconn);
428         return NULL;
429     }
430
431     if (!foundvec && create) {
432         /* No such connection vector exists.  Create one and splice it in.
433          * Make sure the server record has been marked as used (for the purposes
434          * of calculating up & down times, it's now considered to be an
435          * ``active'' server).  Also make sure the server's lastUpdateEvalTime
436          * gets set, marking the time of its ``birth''.
437          */
438         UpgradeSToWLock(&afs_xconn, 37);
439         new_conn_vector(tcv);
440
441         tcv->user = tu;
442         tcv->port = aport;
443         tcv->srvr = sap;
444         tcv->next = sap->conns;
445         if (isrep)
446             tcv->flags |= CONN_REPLICATED;
447         sap->conns = tcv;
448
449         /* all struct afs_conn ptrs come from here */
450         tc = find_preferred_connection(tcv, create);
451
452         afs_ActivateServer(sap);
453
454         ConvertWToSLock(&afs_xconn);
455     } /* end of if (!tcv) */
456
457     if (!tc) {
458         /* Not found and no alternatives. */
459         ReleaseSharedLock(&afs_xconn);
460         return NULL;
461     }
462
463     if (tc->refCount > 10000) {
464         static int warned;
465         if (!warned) {
466             warned = 1;
467             afs_warn("afs: Very high afs_conn refCount detected (conn %p, count %d)\n",
468                      tc, (int)tc->refCount);
469             afs_warn("afs: Trying to continue, but this may indicate an issue\n");
470             afs_warn("afs: that may eventually crash the machine. Please file\n");
471             afs_warn("afs: a bug report.\n");
472         }
473     }
474
475     if (tu->states & UTokensBad) {
476         /* we may still have an authenticated RPC connection here,
477          * we'll have to create a new, unauthenticated, connection.
478          * Perhaps a better way to do this would be to set
479          * conn->forceConnectFS on all conns when the token first goes
480          * bad, but that's somewhat trickier, due to locking
481          * constraints (though not impossible).
482          */
483         if (tc->id && (rx_SecurityClassOf(tc->id) != RX_SECIDX_NULL)) {
484             tc->forceConnectFS = 1;     /* force recreation of connection */
485         }
486         tu->states &= ~UHasTokens;      /* remove the authentication info */
487     }
488
489     glocked = ISAFS_GLOCK();
490     if (tc->forceConnectFS) {
491         UpgradeSToWLock(&afs_xconn, 38);
492         if (tc->id) {
493             if (sap->natping == tc)
494                 sap->natping = NULL;
495             if (glocked)
496                 AFS_GUNLOCK();
497             rx_SetConnSecondsUntilNatPing(tc->id, 0);
498             rx_DestroyConnection(tc->id);
499             if (glocked)
500                 AFS_GLOCK();
501         }
502         /*
503          * Stupid hack to determine if using vldb service or file system
504          * service.
505          */
506         if (aport == sap->server->cell->vlport)
507             service = 52;
508         else
509             service = 1;
510         isec = 0;
511
512         csec = afs_pickSecurityObject(tc, &isec);
513
514         if (glocked)
515             AFS_GUNLOCK();
516         tc->id = rx_NewConnection(sap->sa_ip, aport, service, csec, isec);
517         if (glocked)
518             AFS_GLOCK();
519         if (service == 52) {
520             rx_SetConnHardDeadTime(tc->id, afs_rx_harddead);
521         }
522
523         /* Setting idle dead time to non-zero activates idle-dead
524          * RX_CALL_TIMEOUT errors. */
525         if (isrep)
526             rx_SetConnIdleDeadTime(tc->id, afs_rx_idledead_rep);
527         else
528             rx_SetConnIdleDeadTime(tc->id, afs_rx_idledead);
529
530         /*
531          * Only do this for one connection
532          */
533         if ((service != 52) && (sap->natping == NULL)) {
534             sap->natping = tc;
535             rx_SetConnSecondsUntilNatPing(tc->id, 20);
536         }
537
538         tc->forceConnectFS = 0; /* apparently we're appropriately connected now */
539         if (csec)
540             rxs_Release(csec);
541         ConvertWToSLock(&afs_xconn);
542     } /* end of if (tc->forceConnectFS)*/
543
544     *rxconn = tc->id;
545     rx_GetConnection(*rxconn);
546
547     ReleaseSharedLock(&afs_xconn);
548     return tc;
549 }
550
551 /**
552  * forceConnectFS is set whenever we must recompute the connection. UTokensBad
553  * is true only if we know that the tokens are bad.  We thus clear this flag
554  * when we get a new set of tokens..
555  * Having force... true and UTokensBad true simultaneously means that the tokens
556  * went bad and we're supposed to create a new, unauthenticated, connection.
557  *
558  * @param aserver Server to connect to.
559  * @param aport Connection port.
560  * @param acell The cell where all of this happens.
561  * @param areq The request.
562  * @param aforce Force connection?
563  * @param locktype Type of lock to be used.
564  * @param replicated
565  *
566  * @return The established connection.
567  */
568 struct afs_conn *
569 afs_ConnByHost(struct server *aserver, unsigned short aport, afs_int32 acell,
570                struct vrequest *areq, int aforce, afs_int32 locktype,
571                afs_int32 replicated, struct rx_connection **rxconn)
572 {
573     struct unixuser *tu;
574     struct afs_conn *tc = NULL;
575     struct srvAddr *sa = NULL;
576
577     *rxconn = NULL;
578
579     AFS_STATCNT(afs_ConnByHost);
580
581     if (AFS_IS_DISCONNECTED && !AFS_IN_SYNC) {
582         afs_warnuser("afs_ConnByHost: disconnected\n");
583         return NULL;
584     }
585
586 /*
587   1.  look for an existing connection
588   2.  create a connection at an address believed to be up
589       (if aforce is true, create a connection at the first address)
590 */
591
592     tu = afs_GetUser(areq->uid, acell, SHARED_LOCK);
593
594     for (sa = aserver->addr; sa; sa = sa->next_sa) {
595         tc = afs_ConnBySA(sa, aport, acell, tu, aforce,
596                           0 /*don't create one */ ,
597                           locktype, replicated, rxconn);
598         if (tc)
599             break;
600     }
601
602     if (!tc) {
603         for (sa = aserver->addr; sa; sa = sa->next_sa) {
604             tc = afs_ConnBySA(sa, aport, acell, tu, aforce,
605                               1 /*create one */ ,
606                               locktype, replicated, rxconn);
607             if (tc)
608                 break;
609         }
610     }
611
612     afs_PutUser(tu, SHARED_LOCK);
613     return tc;
614
615 }                               /*afs_ConnByHost */
616
617
618 /**
619  * Connect by multiple hosts.
620  * Try to connect to one of the hosts from the ahosts array.
621  *
622  * @param ahosts Multiple hosts to connect to.
623  * @param aport Connection port.
624  * @param acell The cell where all of this happens.
625  * @param areq The request.
626  * @param locktype Type of lock to be used.
627  * @param replicated
628  *
629  * @return The established connection or NULL.
630  */
631 struct afs_conn *
632 afs_ConnByMHosts(struct server *ahosts[], unsigned short aport,
633                  afs_int32 acell, struct vrequest *areq,
634                  afs_int32 locktype, afs_int32 replicated,
635                  struct rx_connection **rxconn)
636 {
637     afs_int32 i;
638     struct afs_conn *tconn;
639     struct server *ts;
640
641     *rxconn = NULL;
642
643     /* try to find any connection from the set */
644     AFS_STATCNT(afs_ConnByMHosts);
645     for (i = 0; i < AFS_MAXCELLHOSTS; i++) {
646         if ((ts = ahosts[i]) == NULL)
647             break;
648         tconn = afs_ConnByHost(ts, aport, acell, areq, 0, locktype,
649                                replicated, rxconn);
650         if (tconn) {
651             return tconn;
652         }
653     }
654     return NULL;
655
656 }                               /*afs_ConnByMHosts */
657
658
659 /**
660  * Decrement reference count to this connection.
661  * @param ac
662  * @param locktype
663  */
664 void
665 afs_PutConn(struct afs_conn *ac, struct rx_connection *rxconn,
666             afs_int32 locktype)
667 {
668     AFS_STATCNT(afs_PutConn);
669     ac->refCount--;
670     if (ac->refCount < 0) {
671         osi_Panic("afs_PutConn: refcount imbalance 0x%lx %d",
672                   (unsigned long)(uintptrsz)ac, (int)ac->refCount);
673     }
674     ac->parent->refCount--;
675     rx_PutConnection(rxconn);
676 }                               /*afs_PutConn */
677
678
679 /**
680  * Free up a connection vector, allowing, eg, code in afs_user.c
681  * to ignore how connections are stored/pooled
682  * @param tcv
683  */
684 void
685 afs_ReleaseConns(struct sa_conn_vector *tcv) {
686     release_conns_vector(tcv);
687 }
688
689
690 /**
691  * Free connection vector(s) for a user
692  * @param au
693  */
694 void
695 afs_ReleaseConnsUser(struct unixuser *au) {
696
697     int i;
698     struct server *ts;
699
700     for (i = 0; i < NSERVERS; i++) {
701         for (ts = afs_servers[i]; ts; ts = ts->next) {
702             release_conns_user_server(au, ts);
703         }       /*For each server on chain */
704     } /*For each chain */
705 }
706
707
708 /**
709  * For multi homed clients, a RPC may timeout because of a
710  * client network interface going down. We need to reopen new
711  * connections in this case.
712  *
713  * @param sap Server address.
714  */
715 void
716 ForceNewConnections(struct srvAddr *sap)
717 {
718     int cix;
719     struct afs_conn *tc = NULL;
720     struct sa_conn_vector *tcv = NULL;
721
722     if (!sap)
723         return; /* defensive check */
724
725     ObtainWriteLock(&afs_xconn, 413);
726     for (tcv = sap->conns; tcv; tcv = tcv->next) {
727         for(cix = 0; cix < CVEC_LEN; ++cix) {
728             tc = &(tcv->cvec[cix]);
729             if (tc->activated)
730                 tc->forceConnectFS = 1;
731         }
732     }
733     ReleaseWriteLock(&afs_xconn);
734 }
735
736