Print this page
4965 nlm null rpc returns RPC_TIMEDOUT with shorter timeout value

@@ -122,10 +122,15 @@
  * Zero timeout for asynchronous NLM RPC operations
  */
 static const struct timeval nlm_rpctv_zero = { 0,  0 };
 
 /*
+ * Initial timeout for NLM NULL RPC
+ */
+static volatile struct timeval nlm_nullrpc_wait = { 0, 200000 };
+
+/*
  * List of all Zone globals nlm_globals instences
  * linked together.
  */
 static struct nlm_globals_list nlm_zones_list; /* (g) */
 

@@ -525,10 +530,24 @@
          */
         if (procnum >= NLM_TEST_RES && procnum <= NLM_GRANTED_RES)
                 wait = nlm_rpctv_zero;
 
         /*
+         * Default timeout value of 25 seconds can take
+         * nlm_null_rpc() 150 seconds to return RPC_TIMEDOUT 
+         * if it uses UDP and the destination port is 
+         * unreachable.
+         *
+         * A shorter timeout value, e.g. 200 milliseconds,
+         * will cause nlm_null_rpc() to time out after
+         * 200 * (1 + 2 + 4 + 8 + 16 + 32) = 12.6 seconds
+         * (with retries set to 5)
+         */
+        if (procnum == NLM_NULL)
+                wait = nlm_nullrpc_wait;
+
+        /*
          * We need to block signals in case of NLM_CANCEL RPC
          * in order to prevent interruption of network RPC
          * calls.
          */
         if (procnum == NLM_CANCEL) {