svn commit: r317468 - stable/11/sys/fs/nfsclient

Rick Macklem rmacklem at FreeBSD.org
Wed Apr 26 22:17:56 UTC 2017


Author: rmacklem
Date: Wed Apr 26 22:17:54 2017
New Revision: 317468
URL: https://svnweb.freebsd.org/changeset/base/317468

Log:
  MFC: r316719
  Don't throw away Open state when a NFSv4.1 client recovery fails.
  
  If the ExchangeID/CreateSession operations done by an NFSv4.1 client
  after the server crashes/reboots fails, it is possible that some process/thread
  is waiting for an open_owner lock. If the client state is free'd, this
  can cause a crash.
  This would not normally happen, but has been observed on a mount of the
  AmazonEFS service.

Modified:
  stable/11/sys/fs/nfsclient/nfs_clstate.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/fs/nfsclient/nfs_clstate.c
==============================================================================
--- stable/11/sys/fs/nfsclient/nfs_clstate.c	Wed Apr 26 22:11:44 2017	(r317467)
+++ stable/11/sys/fs/nfsclient/nfs_clstate.c	Wed Apr 26 22:17:54 2017	(r317468)
@@ -1934,10 +1934,9 @@ nfscl_recover(struct nfsclclient *clp, s
 	     error == NFSERR_BADSESSION ||
 	     error == NFSERR_STALEDONTRECOVER) && --trycnt > 0);
 	if (error) {
-		nfscl_cleanclient(clp);
 		NFSLOCKCLSTATE();
-		clp->nfsc_flags &= ~(NFSCLFLAGS_HASCLIENTID |
-		    NFSCLFLAGS_RECOVER | NFSCLFLAGS_RECVRINPROG);
+		clp->nfsc_flags &= ~(NFSCLFLAGS_RECOVER |
+		    NFSCLFLAGS_RECVRINPROG);
 		wakeup(&clp->nfsc_flags);
 		nfsv4_unlock(&clp->nfsc_lock, 0);
 		NFSUNLOCKCLSTATE();
@@ -2254,13 +2253,8 @@ nfscl_hasexpired(struct nfsclclient *clp
 	     error == NFSERR_BADSESSION ||
 	     error == NFSERR_STALEDONTRECOVER) && --trycnt > 0);
 	if (error) {
-		/*
-		 * Clear out any state.
-		 */
-		nfscl_cleanclient(clp);
 		NFSLOCKCLSTATE();
-		clp->nfsc_flags &= ~(NFSCLFLAGS_HASCLIENTID |
-		    NFSCLFLAGS_RECOVER);
+		clp->nfsc_flags &= ~NFSCLFLAGS_RECOVER;
 	} else {
 		/*
 		 * Expire the state for the client.


More information about the svn-src-stable-11 mailing list