RX: Avoid timing out non-kernel busy channels
[openafs.git] / src / afs / afs_call.c
index c00931d..01704ad 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright 2000, International Business Machines Corporation and others.
  * All Rights Reserved.
- * 
+ *
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
@@ -110,6 +110,8 @@ afs_InitSetup(int preallocs)
 
     memset(afs_zeros, 0, AFS_ZEROS);
 
+    rx_SetBusyChannelError(RX_CALL_TIMEOUT);
+
     /* start RX */
     if(!afscall_set_rxpck_received)
     rx_extraPackets = AFS_NRXPACKETS;  /* smaller # of packets */
@@ -214,7 +216,6 @@ afs_DaemonOp(long parm, long parm2, long parm3, long parm4, long parm5,
     int code;
     struct afsd_thread_info info;
     thread_t thread;
-
     if (parm == AFSOP_START_RXCALLBACK) {
        if (afs_CB_Running)
            return;
@@ -403,7 +404,7 @@ afs_DaemonOp(long parm, long parm2, long parm3, long parm4, long parm5,
 {
     int code;
     DECLARE_COMPLETION(c);
-#if defined(AFS_LINUX26_ENV) 
+#if defined(AFS_LINUX26_ENV)
 #if defined(INIT_WORK_HAS_DATA)
     struct work_struct tq;
 #endif
@@ -536,7 +537,9 @@ afs_syscall_call(long parm, long parm2, long parm3,
                   sizeof(struct afs_uspc_param), code);
        namebufsz = mvParam->bufSz;
        param1 = afs_osi_Alloc(namebufsz);
+       osi_Assert(param1 != NULL);
        param2 = afs_osi_Alloc(namebufsz);
+       osi_Assert(param2 != NULL);
 
        while (afs_initState < AFSOP_START_BKG)
            afs_osi_Sleep(&afs_initState);
@@ -581,7 +584,7 @@ afs_syscall_call(long parm, long parm2, long parm3,
 #endif /* !RXK_LISTENER_ENV */
        {
 #ifdef RXK_LISTENER_ENV
-           while (afs_RX_Running != 2)
+               while (afs_RX_Running != 2)
                afs_osi_Sleep(&afs_RX_Running);
 #else /* !RXK_LISTENER_ENV */
            afs_initState = AFSOP_START_AFS;
@@ -728,13 +731,14 @@ afs_syscall_call(long parm, long parm2, long parm3,
        case 2:
            afs_tpct2 = parm3;
            break;
-       }           
+       }
     } else if (parm == AFSOP_ADDCELL) {
        /* add a cell.  Parameter 2 is 8 hosts (in net order),  parm 3 is the null-terminated
         * name.  Parameter 4 is the length of the name, including the null.  Parm 5 is the
         * home cell flag (0x1 bit) and the nosuid flag (0x2 bit) */
        struct afsop_cell *tcell = afs_osi_Alloc(sizeof(struct afsop_cell));
 
+       osi_Assert(tcell != NULL);
        code = afs_InitDynroot();
        if (!code) {
            AFS_COPYIN(AFSKPTR(parm2), (caddr_t)tcell->hosts, sizeof(tcell->hosts),
@@ -757,6 +761,9 @@ afs_syscall_call(long parm, long parm2, long parm3,
        char *tbuffer1 = osi_AllocSmallSpace(AFS_SMALLOCSIZ);
        int cflags = parm4;
 
+       osi_Assert(tcell != NULL);
+       osi_Assert(tbuffer != NULL);
+       osi_Assert(tbuffer1 != NULL);
        code = afs_InitDynroot();
        if (!code) {
 #if 0
@@ -850,7 +857,7 @@ afs_syscall_call(long parm, long parm2, long parm3,
            afs_CacheInit(cparms.cacheScaches, cparms.cacheFiles,
                          cparms.cacheBlocks, cparms.cacheDcaches,
                          cparms.cacheVolumes, cparms.chunkSize,
-                         cparms.memCacheFlag, cparms.inodes, cparms.users, 
+                         cparms.memCacheFlag, cparms.inodes, cparms.users,
                          cparms.dynamic_vcaches);
 
     } else if (parm == AFSOP_CACHEINODE) {
@@ -932,7 +939,7 @@ afs_syscall_call(long parm, long parm2, long parm3,
            afs_tpct1 = 0;
            afs_tpct2 = 0;
            splitdcache = 0;
-       } else {        
+       } else {
            splitdcache = 1;
        }
        afs_osi_Wakeup(&afs_initState);
@@ -959,6 +966,9 @@ afs_syscall_call(long parm, long parm2, long parm3,
            afs_osi_Alloc(sizeof(afs_int32) * AFS_MAX_INTERFACE_ADDR);
        int i;
 
+       osi_Assert(buffer != NULL);
+       osi_Assert(maskbuffer != NULL);
+       osi_Assert(mtubuffer != NULL);
        /* This is a refresh */
        if (count & 0x40000000) {
            count &= ~0x40000000;
@@ -967,7 +977,7 @@ afs_syscall_call(long parm, long parm2, long parm3,
            refresh = 1;
        }
 
-       /* Bind, but only if there's only one address configured */ 
+       /* Bind, but only if there's only one address configured */
        if ( count & 0x80000000) {
            count &= ~0x80000000;
            if (count == 1)
@@ -1102,8 +1112,8 @@ afs_syscall_call(long parm, long parm2, long parm3,
        extern u_long sb_max_dflt;
        if (!adjusted) {
          adjusted = 1;
-         if (sb_max_dflt < 131072) sb_max_dflt = 131072; 
-         if (sb_max < 131072) sb_max = 131072; 
+         if (sb_max_dflt < 131072) sb_max_dflt = 131072;
+         if (sb_max < 131072) sb_max = 131072;
        }
       } */
 #endif /* AFS_AIX32_ENV */
@@ -1137,6 +1147,8 @@ afs_syscall_call(long parm, long parm2, long parm3,
        afs_int32 *kmsg = afs_osi_Alloc(kmsgLen);
        char *cellname = afs_osi_Alloc(cellLen);
 
+       osi_Assert(kmsg != NULL);
+       osi_Assert(cellname != NULL);
 #ifndef UKERNEL
        afs_osi_MaskUserLoop();
 #endif