summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient
diff options
context:
space:
mode:
authormohans <mohans@FreeBSD.org>2006-05-26 18:45:55 +0000
committermohans <mohans@FreeBSD.org>2006-05-26 18:45:55 +0000
commitac7b19c8b23d0d3221f798aac9742e59227ede0a (patch)
tree033866ddd0db81d48effe0a6cdba2c98835c1fc8 /sys/nfsclient
parenta45f741c1f2a7b247a94ba7f0e2dfbd3e8cdd31e (diff)
downloadFreeBSD-src-ac7b19c8b23d0d3221f798aac9742e59227ede0a.zip
FreeBSD-src-ac7b19c8b23d0d3221f798aac9742e59227ede0a.tar.gz
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".
Diffstat (limited to 'sys/nfsclient')
-rw-r--r--sys/nfsclient/nfs_vfsops.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c
index 858f405..fdd72f8 100644
--- a/sys/nfsclient/nfs_vfsops.c
+++ b/sys/nfsclient/nfs_vfsops.c
@@ -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);
OpenPOWER on IntegriCloud