Skip to content

Commit

Permalink
Work around the "nfscl: bad open cnt on server" assertion
Browse files Browse the repository at this point in the history
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
  • Loading branch information
trasz committed Feb 19, 2019
1 parent 2e82f60 commit a15d207
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sys/fs/nfsclient/nfs_clstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -3188,8 +3188,11 @@ nfscl_doclose(vnode_t vp, struct nfsclclient **clpp, NFSPROC_T *p)
!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);
Expand Down

0 comments on commit a15d207

Please sign in to comment.