svn commit: r338308 - stable/10/sys/fs/nfs

Rick Macklem rmacklem at FreeBSD.org
Fri Aug 24 22:48:21 UTC 2018


Author: rmacklem
Date: Fri Aug 24 22:48:19 2018
New Revision: 338308
URL: https://svnweb.freebsd.org/changeset/base/338308

Log:
  MFC: r337438
  Allow newnfs_request() to retry all callback RPCs with an NFSERR_DELAY reply.
  
  The code in newnfs_request() retries RPCs that get a reply of NFSERR_DELAY,
  but exempts certain NFSv4 operations. However, for callback RPCs, there
  should not be any exemptions at this time. The code would have erroneously
  exempted the CBRECALL callback, since it has the same operation number as
  the CLOSE operation.
  This patch fixes this by checking for a callback RPC (indicated by clp != NULL)
  and not checking for exempt operations for callbacks.
  This would have only affected the NFSv4 server when delegations are enabled
  (they are not enabled by default) and the client replies to CBRECALL with
  NFSERR_DELAY. This may never actually happen.
  Spotted during code inspection.

Modified:
  stable/10/sys/fs/nfs/nfs_commonkrpc.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/nfs/nfs_commonkrpc.c
==============================================================================
--- stable/10/sys/fs/nfs/nfs_commonkrpc.c	Fri Aug 24 22:41:32 2018	(r338307)
+++ stable/10/sys/fs/nfs/nfs_commonkrpc.c	Fri Aug 24 22:48:19 2018	(r338308)
@@ -964,10 +964,14 @@ tryagain:
 					NFSCL_DEBUG(1, "Got err=%d\n", reterr);
 				}
 			}
+			/*
+			 * When clp != NULL, it is a callback and all
+			 * callback operations can be retried for NFSERR_DELAY.
+			 */
 			if (((nd->nd_repstat == NFSERR_DELAY ||
 			      nd->nd_repstat == NFSERR_GRACE) &&
-			     (nd->nd_flag & ND_NFSV4) &&
-			     nd->nd_procnum != NFSPROC_DELEGRETURN &&
+			     (nd->nd_flag & ND_NFSV4) && (clp != NULL ||
+			     (nd->nd_procnum != NFSPROC_DELEGRETURN &&
 			     nd->nd_procnum != NFSPROC_SETATTR &&
 			     nd->nd_procnum != NFSPROC_READ &&
 			     nd->nd_procnum != NFSPROC_READDS &&
@@ -979,7 +983,7 @@ tryagain:
 			     nd->nd_procnum != NFSPROC_OPENDOWNGRADE &&
 			     nd->nd_procnum != NFSPROC_CLOSE &&
 			     nd->nd_procnum != NFSPROC_LOCK &&
-			     nd->nd_procnum != NFSPROC_LOCKU) ||
+			     nd->nd_procnum != NFSPROC_LOCKU))) ||
 			    (nd->nd_repstat == NFSERR_DELAY &&
 			     (nd->nd_flag & ND_NFSV4) == 0) ||
 			    nd->nd_repstat == NFSERR_RESOURCE) {


More information about the svn-src-all mailing list