diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2004-02-27 17:40:18 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2004-02-27 17:40:18 +0000 |
commit | a6c9c748791861576571a04e9f15d8a861d85a57 (patch) | |
tree | ee9758f13f939963bb26c4be7f6ca6f0cff0cd51 /sys/nfs | |
parent | 3cee92f9131fbe3834f3a5dcae520fdf1369bcb6 (diff) |
Defer use of NFS_ISV3 macro in nfs_link until sanity checks have been done.
Fixes a panic that can occur when trying to link from a local filesystem
to an nfs-mounted one. Problem pointed out by Jim Rees, fix exists
in Net and Free. OK tedu@ csapuntz@
Diffstat (limited to 'sys/nfs')
-rw-r--r-- | sys/nfs/nfs_vnops.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c index 9a52e9b8a47..3b8f276db76 100644 --- a/sys/nfs/nfs_vnops.c +++ b/sys/nfs/nfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_vnops.c,v 1.56 2003/09/23 16:51:13 millert Exp $ */ +/* $OpenBSD: nfs_vnops.c,v 1.57 2004/02/27 17:40:17 millert Exp $ */ /* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */ /* @@ -1611,8 +1611,7 @@ nfs_link(v) caddr_t bpos, dpos, cp2; int error = 0, wccflag = NFSV3_WCCRATTR, attrflag = 0; struct mbuf *mreq, *mrep, *md, *mb, *mb2; - int v3 = NFS_ISV3(vp); - + int v3; if (dvp->v_mount != vp->v_mount) { FREE(cnp->cn_pnbuf, M_NAMEI); @@ -1630,6 +1629,7 @@ nfs_link(v) */ VOP_FSYNC(vp, cnp->cn_cred, MNT_WAIT, cnp->cn_proc); + v3 = NFS_ISV3(vp); nfsstats.rpccnt[NFSPROC_LINK]++; nfsm_reqhead(vp, NFSPROC_LINK, NFSX_FH(v3)*2 + NFSX_UNSIGNED + nfsm_rndup(cnp->cn_namelen)); |