svn commit: r358035 - stable/10/sys/fs/nfsserver

Rick Macklem rmacklem at FreeBSD.org
Mon Feb 17 19:31:35 UTC 2020


Author: rmacklem
Date: Mon Feb 17 19:31:34 2020
New Revision: 358035
URL: https://svnweb.freebsd.org/changeset/base/358035

Log:
  MFC: r357149
  Fix a crash in the NFSv4 server.
  
  The PR reported a crash that occurred when a file was removed while
  client(s) were actively doing lock operations on it.
  Since nfsvno_getvp() will return NULL when the file does not exist,
  the bug was obvious and easy to fix via this patch. It is a little
  surprising that this wasn't found sooner, but I guess the above
  case rarely occurs.
  
  PR:		242768

Modified:
  stable/10/sys/fs/nfsserver/nfs_nfsdstate.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/nfsserver/nfs_nfsdstate.c
==============================================================================
--- stable/10/sys/fs/nfsserver/nfs_nfsdstate.c	Mon Feb 17 19:20:47 2020	(r358034)
+++ stable/10/sys/fs/nfsserver/nfs_nfsdstate.c	Mon Feb 17 19:31:34 2020	(r358035)
@@ -1488,7 +1488,8 @@ nfsrv_freeallnfslocks(struct nfsstate *stp, vnode_t vp
 				tvp = NULL;
 			else if (vp == NULL && cansleep != 0) {
 				tvp = nfsvno_getvp(&lfp->lf_fh);
-				NFSVOPUNLOCK(tvp, 0);
+				if (tvp != NULL)
+					NFSVOPUNLOCK(tvp, 0);
 			} else
 				tvp = vp;
 			gottvp = 1;


More information about the svn-src-stable mailing list