Print this page
NEX-16052 NFS clients cannot reconnect to server after network loss (autofs)
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Joyce McIntosh <joyce.mcintosh@nexenta.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
NEX-4123 xdrmblk_getpos() is unreliable
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
re #13613 rb4516 Tunables needs volatile keyword

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/rpc/clnt_cots.c
          +++ new/usr/src/uts/common/rpc/clnt_cots.c
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23      - * Copyright 2016 Nexenta Systems, Inc.  All rights reserved.
       23 + * Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
  24   24   * Copyright (c) 2016 by Delphix. All rights reserved.
  25   25   */
  26   26  
  27   27  /*
  28   28   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  29   29   * Use is subject to license terms.
  30   30   */
  31   31  
  32   32  /*
  33   33   * Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T
↓ open down ↓ 433 lines elided ↑ open up ↑
 467  467          { "timers",     KSTAT_DATA_UINT64 },
 468  468          { "cantconn",   KSTAT_DATA_UINT64 },
 469  469          { "nomem",      KSTAT_DATA_UINT64 },
 470  470          { "interrupts", KSTAT_DATA_UINT64 }
 471  471  };
 472  472  
 473  473  #define COTSRCSTAT_INCR(p, x)   \
 474  474          atomic_inc_64(&(p)->x.value.ui64)
 475  475  
 476  476  #define CLNT_MAX_CONNS  1       /* concurrent connections between clnt/srvr */
 477      -int clnt_max_conns = CLNT_MAX_CONNS;
      477 +volatile int clnt_max_conns = CLNT_MAX_CONNS;
 478  478  
 479  479  #define CLNT_MIN_TIMEOUT        10      /* seconds to wait after we get a */
 480  480                                          /* connection reset */
 481  481  #define CLNT_MIN_CONNTIMEOUT    5       /* seconds to wait for a connection */
 482  482  
 483  483  
 484  484  int clnt_cots_min_tout = CLNT_MIN_TIMEOUT;
 485  485  int clnt_cots_min_conntout = CLNT_MIN_CONNTIMEOUT;
 486  486  
 487  487  /*
↓ open down ↓ 1785 lines elided ↑ open up ↑
2273 2273          if (cm_entry->x_early_disc) {
2274 2274                  /*
2275 2275                   * We need to check if a disconnect request has come
2276 2276                   * while we are connected, if so, then we need to
2277 2277                   * set rpcerr->re_status appropriately before returning
2278 2278                   * NULL to caller.
2279 2279                   */
2280 2280                  if (rpcerr->re_status == RPC_SUCCESS)
2281 2281                          rpcerr->re_status = RPC_XPRTFAILED;
2282 2282                  cm_entry->x_connected = FALSE;
     2283 +                cm_entry->x_dead = TRUE;
2283 2284          } else
2284 2285                  cm_entry->x_connected = connected;
2285 2286  
2286 2287          /*
2287 2288           * There could be a discrepancy here such that
2288 2289           * x_early_disc is TRUE yet connected is TRUE as well
2289 2290           * and the connection is actually connected. In that case
2290 2291           * lets be conservative and declare the connection as not
2291 2292           * connected.
2292 2293           */
↓ open down ↓ 98 lines elided ↑ open up ↑
2391 2392                  if (cm_entry->x_early_disc) {
2392 2393                          /*
2393 2394                           * We need to check if a disconnect request has come
2394 2395                           * while we are connected, if so, then we need to
2395 2396                           * set rpcerr->re_status appropriately before returning
2396 2397                           * NULL to caller.
2397 2398                           */
2398 2399                          if (rpcerr->re_status == RPC_SUCCESS)
2399 2400                                  rpcerr->re_status = RPC_XPRTFAILED;
2400 2401                          cm_entry->x_connected = FALSE;
     2402 +                        cm_entry->x_dead = TRUE;
2401 2403                  } else
2402 2404                          cm_entry->x_connected = connected;
2403 2405  
2404 2406                  /*
2405 2407                   * There could be a discrepancy here such that
2406 2408                   * x_early_disc is TRUE yet connected is TRUE as well
2407 2409                   * and the connection is actually connected. In that case
2408 2410                   * lets be conservative and declare the connection as not
2409 2411                   * connected.
2410 2412                   */
↓ open down ↓ 1350 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX