mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-03 08:22:44 +00:00
Fixed VOP_LINK argument order botch.
This commit is contained in:
parent
c5f944ee5a
commit
9879652657
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=9354
@ -1,4 +1,4 @@
|
|||||||
/* $Id: msdosfs_vnops.c,v 1.16.2.3 1995/06/02 11:03:15 davidg Exp $ */
|
/* $Id: msdosfs_vnops.c,v 1.17 1995/06/11 19:31:37 rgrimes Exp $ */
|
||||||
/* $NetBSD: msdosfs_vnops.c,v 1.20 1994/08/21 18:44:13 ws Exp $ */
|
/* $NetBSD: msdosfs_vnops.c,v 1.20 1994/08/21 18:44:13 ws Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
@ -908,8 +908,8 @@ msdosfs_link(ap)
|
|||||||
struct componentname *a_cnp;
|
struct componentname *a_cnp;
|
||||||
} */ *ap;
|
} */ *ap;
|
||||||
{
|
{
|
||||||
VOP_ABORTOP(ap->a_vp, ap->a_cnp);
|
VOP_ABORTOP(ap->a_tdvp, ap->a_cnp);
|
||||||
vput(ap->a_vp);
|
vput(ap->a_tdvp);
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)union_vnops.c 8.6 (Berkeley) 2/17/94
|
* @(#)union_vnops.c 8.6 (Berkeley) 2/17/94
|
||||||
* $Id: union_vnops.c,v 1.7 1994/10/10 07:55:48 phk Exp $
|
* $Id: union_vnops.c,v 1.8 1994/11/04 14:41:46 davidg Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -919,7 +919,7 @@ union_link(ap)
|
|||||||
VREF(vp);
|
VREF(vp);
|
||||||
vrele(ap->a_tdvp);
|
vrele(ap->a_tdvp);
|
||||||
|
|
||||||
error = VOP_LINK(dvp, vp, ap->a_cnp);
|
error = VOP_LINK(vp, dvp, ap->a_cnp);
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* XXX: need to copy to upper layer
|
* XXX: need to copy to upper layer
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
|
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
|
||||||
* $Id: vfs_syscalls.c,v 1.24 1995/05/15 08:39:31 davidg Exp $
|
* $Id: vfs_syscalls.c,v 1.25 1995/05/21 21:38:52 davidg Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -844,7 +844,7 @@ link(p, uap, retval)
|
|||||||
p, p->p_ucred, LEASE_WRITE);
|
p, p->p_ucred, LEASE_WRITE);
|
||||||
LEASE_CHECK(vp,
|
LEASE_CHECK(vp,
|
||||||
p, p->p_ucred, LEASE_WRITE);
|
p, p->p_ucred, LEASE_WRITE);
|
||||||
error = VOP_LINK(nd.ni_dvp, vp, &nd.ni_cnd);
|
error = VOP_LINK(vp, nd.ni_dvp, &nd.ni_cnd);
|
||||||
} else {
|
} else {
|
||||||
VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
|
VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
|
||||||
if (nd.ni_dvp == nd.ni_vp)
|
if (nd.ni_dvp == nd.ni_vp)
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
|
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
|
||||||
* $Id: vfs_syscalls.c,v 1.24 1995/05/15 08:39:31 davidg Exp $
|
* $Id: vfs_syscalls.c,v 1.25 1995/05/21 21:38:52 davidg Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -844,7 +844,7 @@ link(p, uap, retval)
|
|||||||
p, p->p_ucred, LEASE_WRITE);
|
p, p->p_ucred, LEASE_WRITE);
|
||||||
LEASE_CHECK(vp,
|
LEASE_CHECK(vp,
|
||||||
p, p->p_ucred, LEASE_WRITE);
|
p, p->p_ucred, LEASE_WRITE);
|
||||||
error = VOP_LINK(nd.ni_dvp, vp, &nd.ni_cnd);
|
error = VOP_LINK(vp, nd.ni_dvp, &nd.ni_cnd);
|
||||||
} else {
|
} else {
|
||||||
VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
|
VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
|
||||||
if (nd.ni_dvp == nd.ni_vp)
|
if (nd.ni_dvp == nd.ni_vp)
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
# SUCH DAMAGE.
|
# SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
# @(#)vnode_if.src 8.3 (Berkeley) 2/3/94
|
# @(#)vnode_if.src 8.3 (Berkeley) 2/3/94
|
||||||
# $Id: vnode_if.src,v 1.2 1994/08/02 07:43:37 davidg Exp $
|
# $Id: vnode_if.src,v 1.3 1994/09/28 16:45:12 dfr Exp $
|
||||||
#
|
#
|
||||||
vop_lookup {
|
vop_lookup {
|
||||||
IN struct vnode *dvp;
|
IN struct vnode *dvp;
|
||||||
@ -149,8 +149,8 @@ vop_remove {
|
|||||||
};
|
};
|
||||||
|
|
||||||
vop_link {
|
vop_link {
|
||||||
IN WILLRELE struct vnode *vp;
|
IN struct vnode *vp;
|
||||||
IN struct vnode *tdvp;
|
IN WILLRELE struct vnode *tdvp;
|
||||||
IN struct componentname *cnp;
|
IN struct componentname *cnp;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)union_vnops.c 8.6 (Berkeley) 2/17/94
|
* @(#)union_vnops.c 8.6 (Berkeley) 2/17/94
|
||||||
* $Id: union_vnops.c,v 1.7 1994/10/10 07:55:48 phk Exp $
|
* $Id: union_vnops.c,v 1.8 1994/11/04 14:41:46 davidg Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -919,7 +919,7 @@ union_link(ap)
|
|||||||
VREF(vp);
|
VREF(vp);
|
||||||
vrele(ap->a_tdvp);
|
vrele(ap->a_tdvp);
|
||||||
|
|
||||||
error = VOP_LINK(dvp, vp, ap->a_cnp);
|
error = VOP_LINK(vp, dvp, ap->a_cnp);
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* XXX: need to copy to upper layer
|
* XXX: need to copy to upper layer
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: msdosfs_vnops.c,v 1.16.2.3 1995/06/02 11:03:15 davidg Exp $ */
|
/* $Id: msdosfs_vnops.c,v 1.17 1995/06/11 19:31:37 rgrimes Exp $ */
|
||||||
/* $NetBSD: msdosfs_vnops.c,v 1.20 1994/08/21 18:44:13 ws Exp $ */
|
/* $NetBSD: msdosfs_vnops.c,v 1.20 1994/08/21 18:44:13 ws Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
@ -908,8 +908,8 @@ msdosfs_link(ap)
|
|||||||
struct componentname *a_cnp;
|
struct componentname *a_cnp;
|
||||||
} */ *ap;
|
} */ *ap;
|
||||||
{
|
{
|
||||||
VOP_ABORTOP(ap->a_vp, ap->a_cnp);
|
VOP_ABORTOP(ap->a_tdvp, ap->a_cnp);
|
||||||
vput(ap->a_vp);
|
vput(ap->a_tdvp);
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)nfs_serv.c 8.3 (Berkeley) 1/12/94
|
* @(#)nfs_serv.c 8.3 (Berkeley) 1/12/94
|
||||||
* $Id: nfs_serv.c,v 1.15 1995/06/11 19:31:45 rgrimes Exp $
|
* $Id: nfs_serv.c,v 1.16 1995/06/27 11:06:37 dfr Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2026,7 +2026,7 @@ out:
|
|||||||
if (!error) {
|
if (!error) {
|
||||||
nqsrv_getl(vp, ND_WRITE);
|
nqsrv_getl(vp, ND_WRITE);
|
||||||
nqsrv_getl(xp, ND_WRITE);
|
nqsrv_getl(xp, ND_WRITE);
|
||||||
#if defined(__FreeBSD__) || defined(__NetBSD__)
|
#if defined(__NetBSD__)
|
||||||
error = VOP_LINK(nd.ni_dvp, vp, &nd.ni_cnd);
|
error = VOP_LINK(nd.ni_dvp, vp, &nd.ni_cnd);
|
||||||
#else
|
#else
|
||||||
error = VOP_LINK(vp, nd.ni_dvp, &nd.ni_cnd);
|
error = VOP_LINK(vp, nd.ni_dvp, &nd.ni_cnd);
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)nfs_vnops.c 8.5 (Berkeley) 2/13/94
|
* @(#)nfs_vnops.c 8.5 (Berkeley) 2/13/94
|
||||||
* $Id: nfs_vnops.c,v 1.15 1995/05/30 08:12:49 rgrimes Exp $
|
* $Id: nfs_vnops.c,v 1.16 1995/06/27 11:06:53 dfr Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1651,7 +1651,7 @@ nfs_link(ap)
|
|||||||
struct componentname *a_cnp;
|
struct componentname *a_cnp;
|
||||||
} */ *ap;
|
} */ *ap;
|
||||||
{
|
{
|
||||||
#if defined(__FreeBSD__) || defined(__NetBSD__)
|
#if defined(__NetBSD__)
|
||||||
/*
|
/*
|
||||||
* Since the args are reversed in the VOP_LINK() calls,
|
* Since the args are reversed in the VOP_LINK() calls,
|
||||||
* switch them back. Argh!
|
* switch them back. Argh!
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)nfs_vnops.c 8.5 (Berkeley) 2/13/94
|
* @(#)nfs_vnops.c 8.5 (Berkeley) 2/13/94
|
||||||
* $Id: nfs_vnops.c,v 1.15 1995/05/30 08:12:49 rgrimes Exp $
|
* $Id: nfs_vnops.c,v 1.16 1995/06/27 11:06:53 dfr Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1651,7 +1651,7 @@ nfs_link(ap)
|
|||||||
struct componentname *a_cnp;
|
struct componentname *a_cnp;
|
||||||
} */ *ap;
|
} */ *ap;
|
||||||
{
|
{
|
||||||
#if defined(__FreeBSD__) || defined(__NetBSD__)
|
#if defined(__NetBSD__)
|
||||||
/*
|
/*
|
||||||
* Since the args are reversed in the VOP_LINK() calls,
|
* Since the args are reversed in the VOP_LINK() calls,
|
||||||
* switch them back. Argh!
|
* switch them back. Argh!
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)nfs_serv.c 8.3 (Berkeley) 1/12/94
|
* @(#)nfs_serv.c 8.3 (Berkeley) 1/12/94
|
||||||
* $Id: nfs_serv.c,v 1.15 1995/06/11 19:31:45 rgrimes Exp $
|
* $Id: nfs_serv.c,v 1.16 1995/06/27 11:06:37 dfr Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2026,7 +2026,7 @@ out:
|
|||||||
if (!error) {
|
if (!error) {
|
||||||
nqsrv_getl(vp, ND_WRITE);
|
nqsrv_getl(vp, ND_WRITE);
|
||||||
nqsrv_getl(xp, ND_WRITE);
|
nqsrv_getl(xp, ND_WRITE);
|
||||||
#if defined(__FreeBSD__) || defined(__NetBSD__)
|
#if defined(__NetBSD__)
|
||||||
error = VOP_LINK(nd.ni_dvp, vp, &nd.ni_cnd);
|
error = VOP_LINK(nd.ni_dvp, vp, &nd.ni_cnd);
|
||||||
#else
|
#else
|
||||||
error = VOP_LINK(vp, nd.ni_dvp, &nd.ni_cnd);
|
error = VOP_LINK(vp, nd.ni_dvp, &nd.ni_cnd);
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)lfs_vnops.c 8.5 (Berkeley) 12/30/93
|
* @(#)lfs_vnops.c 8.5 (Berkeley) 12/30/93
|
||||||
* $Id: lfs_vnops.c,v 1.8 1995/04/09 06:03:42 davidg Exp $
|
* $Id: lfs_vnops.c,v 1.9 1995/05/30 08:15:27 rgrimes Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -388,10 +388,10 @@ lfs_link(ap)
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
SET_DIROP(VTOI(ap->a_vp)->i_lfs);
|
SET_DIROP(VTOI(ap->a_tdvp)->i_lfs);
|
||||||
MARK_VNODE(ap->a_vp);
|
MARK_VNODE(ap->a_tdvp);
|
||||||
ret = ufs_link(ap);
|
ret = ufs_link(ap);
|
||||||
SET_ENDOP(VTOI(ap->a_vp)->i_lfs);
|
SET_ENDOP(VTOI(ap->a_tdvp)->i_lfs);
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)ufs_vnops.c 8.10 (Berkeley) 4/1/94
|
* @(#)ufs_vnops.c 8.10 (Berkeley) 4/1/94
|
||||||
* $Id: ufs_vnops.c,v 1.23 1995/05/15 07:31:09 davidg Exp $
|
* $Id: ufs_vnops.c,v 1.24 1995/05/30 08:15:39 rgrimes Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -683,31 +683,31 @@ ufs_link(ap)
|
|||||||
panic("ufs_link: no name");
|
panic("ufs_link: no name");
|
||||||
#endif
|
#endif
|
||||||
if (vp->v_mount != tdvp->v_mount) {
|
if (vp->v_mount != tdvp->v_mount) {
|
||||||
VOP_ABORTOP(vp, cnp);
|
VOP_ABORTOP(tdvp, cnp);
|
||||||
error = EXDEV;
|
error = EXDEV;
|
||||||
goto out2;
|
goto out2;
|
||||||
}
|
}
|
||||||
if (vp != tdvp && (error = VOP_LOCK(tdvp))) {
|
if (vp != tdvp && (error = VOP_LOCK(vp))) {
|
||||||
VOP_ABORTOP(vp, cnp);
|
VOP_ABORTOP(tdvp, cnp);
|
||||||
goto out2;
|
goto out2;
|
||||||
}
|
}
|
||||||
ip = VTOI(tdvp);
|
ip = VTOI(vp);
|
||||||
if ((nlink_t)ip->i_nlink >= LINK_MAX) {
|
if ((nlink_t)ip->i_nlink >= LINK_MAX) {
|
||||||
VOP_ABORTOP(vp, cnp);
|
VOP_ABORTOP(tdvp, cnp);
|
||||||
error = EMLINK;
|
error = EMLINK;
|
||||||
goto out1;
|
goto out1;
|
||||||
}
|
}
|
||||||
if (ip->i_flags & (IMMUTABLE | APPEND)) {
|
if (ip->i_flags & (IMMUTABLE | APPEND)) {
|
||||||
VOP_ABORTOP(vp, cnp);
|
VOP_ABORTOP(tdvp, cnp);
|
||||||
error = EPERM;
|
error = EPERM;
|
||||||
goto out1;
|
goto out1;
|
||||||
}
|
}
|
||||||
ip->i_nlink++;
|
ip->i_nlink++;
|
||||||
ip->i_flag |= IN_CHANGE;
|
ip->i_flag |= IN_CHANGE;
|
||||||
tv = time;
|
tv = time;
|
||||||
error = VOP_UPDATE(tdvp, &tv, &tv, 1);
|
error = VOP_UPDATE(vp, &tv, &tv, 1);
|
||||||
if (!error)
|
if (!error)
|
||||||
error = ufs_direnter(ip, vp, cnp);
|
error = ufs_direnter(ip, tdvp, cnp);
|
||||||
if (error) {
|
if (error) {
|
||||||
ip->i_nlink--;
|
ip->i_nlink--;
|
||||||
ip->i_flag |= IN_CHANGE;
|
ip->i_flag |= IN_CHANGE;
|
||||||
@ -715,9 +715,9 @@ ufs_link(ap)
|
|||||||
FREE(cnp->cn_pnbuf, M_NAMEI);
|
FREE(cnp->cn_pnbuf, M_NAMEI);
|
||||||
out1:
|
out1:
|
||||||
if (vp != tdvp)
|
if (vp != tdvp)
|
||||||
VOP_UNLOCK(tdvp);
|
VOP_UNLOCK(vp);
|
||||||
out2:
|
out2:
|
||||||
vput(vp);
|
vput(tdvp);
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user