Fix for a potential attempt to sleep while holding nm_mtx. Caught and reported

by Witness (which forces the mbuf allocation flag to M_NOWAIT).

Reported by: "sekes".
This commit is contained in:
Mohan Srinivasan 2006-05-26 18:45:55 +00:00
parent 05c3592e13
commit 1af6f471ca
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=158965

View file

@ -332,9 +332,9 @@ nfs_fsinfo(struct nfsmount *nmp, struct vnode *vp, struct ucred *cred,
nfsm_request(vp, NFSPROC_FSINFO, td, cred);
nfsm_postop_attr(vp, retattr);
if (!error) {
mtx_lock(&nmp->nm_mtx);
fsp = nfsm_dissect(struct nfsv3_fsinfo *, NFSX_V3FSINFO);
pref = fxdr_unsigned(u_int32_t, fsp->fs_wtpref);
mtx_lock(&nmp->nm_mtx);
if (pref < nmp->nm_wsize && pref >= NFS_FABLKSIZE)
nmp->nm_wsize = (pref + NFS_FABLKSIZE - 1) &
~(NFS_FABLKSIZE - 1);