Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Feb 2020 19:40:26 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r358037 - stable/11/sys/fs/nfsserver
Message-ID:  <202002171940.01HJeQGM045164@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Mon Feb 17 19:40:26 2020
New Revision: 358037
URL: https://svnweb.freebsd.org/changeset/base/358037

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/11/sys/fs/nfsserver/nfs_nfsdstate.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/fs/nfsserver/nfs_nfsdstate.c
==============================================================================
--- stable/11/sys/fs/nfsserver/nfs_nfsdstate.c	Mon Feb 17 19:32:54 2020	(r358036)
+++ stable/11/sys/fs/nfsserver/nfs_nfsdstate.c	Mon Feb 17 19:40:26 2020	(r358037)
@@ -1483,7 +1483,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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202002171940.01HJeQGM045164>