On Wed, Apr 11, 2018 at 12:34:03PM +0200, Martin Pieuchot wrote: > On 09/04/18(Mon) 16:10, Martin Pieuchot wrote: > > Diff below implements most of the missing locking goo for NFS without > > enabling it. It does the following: > > > > - Add a missing PDIRUNLOCK in nfs_lookup() > > > > - Change vrele(9) into vput(9) where necessary. nfs_nget() will in > > future return a locked NFSnode. Just like ffs_vget() returns a > > locked vnode. So every time it is called we need a corresponding > > vput(9). > > > > - Make sure VN_KNOTE() is always called with a valid reference, before > > vrele(9) or vput(9). > > > > - Substitute an XXX by an assert in nfs_removeit(). > > > > However as long as nfs_lock/unlock are noops, this diff should not > > introduce any change in behavior. But please do test this diff :) > > New version of the diff after a review from visa@. It includes: > > - Stop calling vput(9) inside nfs_mknodrpc() to be able to call > VN_KNOTE() with a proper reference in nfs_mknod(). > > - Do not unconditionally unlock a node in an error case in > nfs_lookitup(). > > - Fix a dangling reference in the case of 'goto again' in nfs_create().
OK visa@, with one more tweak: The KASSERT(VOP_ISLOCKED(sp->s_dvp)) in nfs_removeit() should be commented out until the locking is enabled. Currently, VOP_ISLOCKED() returns zero with NFS vnodes.
