mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-25 11:37:56 +00:00
Add acquisition of a reference count on nfsv4root_lock to the
nfsd_recalldelegation() function, since this function is called by nfsd threads when they are handling NFSv2 or NFSv3 RPCs, where no reference count would have been acquired. MFC after: 2 weeks
This commit is contained in:
parent
2ec3f92528
commit
b5cb66df25
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=211953
@ -4562,6 +4562,14 @@ nfsd_recalldelegation(vnode_t vp, NFSPROC_T *p)
|
||||
nfsrv_issuedelegs == 0)
|
||||
return;
|
||||
|
||||
/*
|
||||
* First, get a reference on the nfsv4rootfs_lock so that an
|
||||
* exclusive lock cannot be acquired by another thread.
|
||||
*/
|
||||
NFSLOCKV4ROOTMUTEX();
|
||||
nfsv4_getref(&nfsv4rootfs_lock, NULL, NFSV4ROOTLOCKMUTEXPTR);
|
||||
NFSUNLOCKV4ROOTMUTEX();
|
||||
|
||||
/*
|
||||
* Now, call nfsrv_checkremove() in a loop while it returns
|
||||
* NFSERR_DELAY. Return upon any other error or when timed out.
|
||||
@ -4576,11 +4584,14 @@ nfsd_recalldelegation(vnode_t vp, NFSPROC_T *p)
|
||||
NFS_REMOVETIMEO &&
|
||||
((u_int32_t)mytime.tv_sec - starttime) <
|
||||
100000)
|
||||
return;
|
||||
break;
|
||||
/* Sleep for a short period of time */
|
||||
(void) nfs_catnap(PZERO, 0, "nfsremove");
|
||||
}
|
||||
} while (error == NFSERR_DELAY);
|
||||
NFSLOCKV4ROOTMUTEX();
|
||||
nfsv4_relref(&nfsv4rootfs_lock);
|
||||
NFSUNLOCKV4ROOTMUTEX();
|
||||
}
|
||||
|
||||
APPLESTATIC void
|
||||
|
Loading…
Reference in New Issue
Block a user