Add LK_NOWITNESS to the vn_lock() calls done on newly created nfs
vnodes, since these nodes are not linked into the mount queue and, as such, the vn_lock() cannot cause a deadlock so LORs are harmless. Suggested by: kib Approved by: kib (mentor) MFC after: 3 days
This commit is contained in:
parent
469c3a5ff4
commit
8f63187ec1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=197048
@ -157,7 +157,7 @@ ncl_nget(struct mount *mntp, u_int8_t *fhp, int fhsize, struct nfsnode **npp)
|
||||
M_NFSFH, M_WAITOK);
|
||||
bcopy(fhp, np->n_fhp->nfh_fh, fhsize);
|
||||
np->n_fhp->nfh_len = fhsize;
|
||||
lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL);
|
||||
lockmgr(vp->v_vnlock, LK_EXCLUSIVE | LK_NOWITNESS, NULL);
|
||||
error = insmntque(vp, mntp);
|
||||
if (error != 0) {
|
||||
*npp = NULL;
|
||||
|
@ -232,7 +232,7 @@ nfscl_nget(struct mount *mntp, struct vnode *dvp, struct nfsfh *nfhp,
|
||||
*/
|
||||
VN_LOCK_AREC(vp);
|
||||
VN_LOCK_ASHARE(vp);
|
||||
lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL);
|
||||
lockmgr(vp->v_vnlock, LK_EXCLUSIVE | LK_NOWITNESS, NULL);
|
||||
error = insmntque(vp, mntp);
|
||||
if (error != 0) {
|
||||
*npp = NULL;
|
||||
|
@ -158,7 +158,7 @@ nfs_nget(struct mount *mntp, nfsfh_t *fhp, int fhsize, struct nfsnode **npp, int
|
||||
np->n_fhp = &np->n_fh;
|
||||
bcopy((caddr_t)fhp, (caddr_t)np->n_fhp, fhsize);
|
||||
np->n_fhsize = fhsize;
|
||||
lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL);
|
||||
lockmgr(vp->v_vnlock, LK_EXCLUSIVE | LK_NOWITNESS, NULL);
|
||||
error = insmntque(vp, mntp);
|
||||
if (error != 0) {
|
||||
*npp = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user