Author: trasz
Date: Tue Feb 19 12:45:37 2019
New Revision: 344277
URL: https://svnweb.freebsd.org/changeset/base/344277

Log:
  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

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. */
+#ifdef DIAGNOSTIC
                                KASSERT((op->nfso_opencnt == 0),
-                                   ("nfscl: bad open cnt on server"));
+                                   ("nfscl: bad open cnt on server (%d)",
+                                    op->nfso_opencnt));
+#endif
                                NFSUNLOCKCLSTATE();
                                nfsrpc_doclose(VFSTONFS(vnode_mount(vp)), op,
                                    p);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to