svn commit: r344277 - head/sys/fs/nfsclient

Edward Tomasz Napierala trasz at
Tue Feb 19 12:45:38 UTC 2019

Author: trasz
Date: Tue Feb 19 12:45:37 2019
New Revision: 344277

  Work around the "nfscl: bad open cnt on server" assertion
  that can happen when rerooting into NFSv4 rootfs with kernel
  built with INVARIANTS.
  I've talked to rmacklem@ (back in 2017), and while the root cause
  is still unknown, the case guarded by assertion (nfscl_doclose()
  being called from VOP_INACTIVE) is believed to be safe, and the
  whole thing seems to run just fine.
  Obtained from:	CheriBSD
  MFC after:	2 weeks
  Sponsored by:	DARPA, AFRL


Modified: head/sys/fs/nfsclient/nfs_clstate.c
--- head/sys/fs/nfsclient/nfs_clstate.c	Tue Feb 19 11:07:02 2019	(r344276)
+++ head/sys/fs/nfsclient/nfs_clstate.c	Tue Feb 19 12:45:37 2019	(r344277)
@@ -3188,8 +3188,11 @@ lookformore:
 			    !NFSBCMP(op->nfso_fh, nfhp->nfh_fh,
 			    nfhp->nfh_len)) {
 				/* Found an open, close it. */
 				KASSERT((op->nfso_opencnt == 0),
-				    ("nfscl: bad open cnt on server"));
+				    ("nfscl: bad open cnt on server (%d)",
+				     op->nfso_opencnt));
 				nfsrpc_doclose(VFSTONFS(vnode_mount(vp)), op,

More information about the svn-src-all mailing list