summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormohans <mohans@FreeBSD.org>2007-02-11 04:01:10 +0000
committermohans <mohans@FreeBSD.org>2007-02-11 04:01:10 +0000
commit6d93e146370ae32115c6cdf753c9f36a0c8068f4 (patch)
tree0dc71542b58d764f73dcbff7fe5dadd703259d37
parente43343208a46298418acd1048b929ddbb06c8256 (diff)
downloadFreeBSD-src-6d93e146370ae32115c6cdf753c9f36a0c8068f4.zip
FreeBSD-src-6d93e146370ae32115c6cdf753c9f36a0c8068f4.tar.gz
Add missing MNT_ILOCK around some mnt_kern_flag accesses.
-rw-r--r--sys/nfsclient/nfs_socket.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/nfsclient/nfs_socket.c b/sys/nfsclient/nfs_socket.c
index 6036050..4422f06 100644
--- a/sys/nfsclient/nfs_socket.c
+++ b/sys/nfsclient/nfs_socket.c
@@ -1091,10 +1091,13 @@ nfs_request(struct vnode *vp, struct mbuf *mrest, int procnum,
u_int32_t *xidp;
/* Reject requests while attempting a forced unmount. */
+ MNT_ILOCK(vp->v_mount);
if (vp->v_mount->mnt_kern_flag & MNTK_UNMOUNTF) {
+ MNT_IUNLOCK(vp->v_mount);
m_freem(mrest);
return (ESTALE);
}
+ MNT_IUNLOCK(vp->v_mount);
nmp = VFSTONFS(vp->v_mount);
if ((nmp->nm_flag & NFSMNT_NFSV4) != 0)
return nfs4_request(vp, mrest, procnum, td, cred, mrp, mdp, dposp);
@@ -1703,10 +1706,13 @@ nfs_sigintr(struct nfsmount *nmp, struct nfsreq *rep, struct thread *td)
mtx_unlock(&rep->r_mtx);
}
/* Terminate all requests while attempting a forced unmount. */
+ MNT_ILOCK(nmp->nm_mountp);
if (nmp->nm_mountp->mnt_kern_flag & MNTK_UNMOUNTF) {
+ MNT_IUNLOCK(nmp->nm_mountp);
error = EIO;
goto out;
}
+ MNT_IUNLOCK(nmp->nm_mountp);
if (!(nmp->nm_flag & NFSMNT_INT))
goto out;
if (td == NULL)
OpenPOWER on IntegriCloud