? nfs.diff ? o Index: nfs_clntsubs.c =================================================================== RCS file: /cvsroot/src/sys/nfs/nfs_clntsubs.c,v retrieving revision 1.4 diff -u -p -u -r1.4 nfs_clntsubs.c --- nfs_clntsubs.c 23 Feb 2020 15:46:41 -0000 1.4 +++ nfs_clntsubs.c 22 Apr 2021 17:30:08 -0000 @@ -360,9 +360,20 @@ nfs_delayedtruncate(struct vnode *vp) np->n_flag &= ~NTRUNCDELAYED; genfs_node_wrlock(vp); rw_enter(vp->v_uobj.vmobjlock, RW_WRITER); + + /* + * This is disgusting but we can be called from VOP_UNLOCK + * where the interlock is sometimes held, and we want to + * make sure that it is unlocked when we call VOP_PUTPAGES + * and uvm_vnp_setsize. + */ + int got = mutex_tryenter(vp->v_interlock); + mutex_exit(vp->v_interlock); (void)VOP_PUTPAGES(vp, 0, 0, PGO_SYNCIO | PGO_CLEANIT | PGO_FREE | PGO_ALLPAGES); uvm_vnp_setsize(vp, np->n_size); + if (!got) + mutex_enter(vp->v_interlock); genfs_node_unlock(vp); } }