diff options
author | dg <dg@FreeBSD.org> | 1995-08-01 18:51:02 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1995-08-01 18:51:02 +0000 |
commit | 21cc29328e0ec5d81f23c44eb23b19d99f7e691f (patch) | |
tree | 7e1c28d400c2c70e77cbca3654c9d1ca5443bae3 /sys/kern/vfs_extattr.c | |
parent | c93738880cf44616a99a51717df53b16bac0effb (diff) | |
download | FreeBSD-src-21cc29328e0ec5d81f23c44eb23b19d99f7e691f.zip FreeBSD-src-21cc29328e0ec5d81f23c44eb23b19d99f7e691f.tar.gz |
Removed my special-case hack for VOP_LINK and fixed the problem with the
wrong vp's ops vector being used by changing the VOP_LINK's argument order.
The special-case hack doesn't go far enough and breaks the generic
bypass routine used in some non-leaf filesystems. Pointed out by Kirk
McKusick.
Diffstat (limited to 'sys/kern/vfs_extattr.c')
-rw-r--r-- | sys/kern/vfs_extattr.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index c9f62ab..99e2b58 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94 - * $Id: vfs_syscalls.c,v 1.28 1995/07/13 08:47:42 davidg Exp $ + * $Id: vfs_syscalls.c,v 1.29 1995/07/31 00:35:47 bde Exp $ */ #include <sys/param.h> @@ -839,15 +839,7 @@ link(p, uap, retval) nd.ni_dirp = uap->link; error = namei(&nd); if (!error) { - if (nd.ni_vp != NULL) - error = EEXIST; - if (!error) { - LEASE_CHECK(nd.ni_dvp, - p, p->p_ucred, LEASE_WRITE); - LEASE_CHECK(vp, - p, p->p_ucred, LEASE_WRITE); - error = VOP_LINK(vp, nd.ni_dvp, &nd.ni_cnd); - } else { + if (nd.ni_vp != NULL) { VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd); if (nd.ni_dvp == nd.ni_vp) vrele(nd.ni_dvp); @@ -855,6 +847,13 @@ link(p, uap, retval) vput(nd.ni_dvp); if (nd.ni_vp) vrele(nd.ni_vp); + error = EEXIST; + } else { + LEASE_CHECK(nd.ni_dvp, + p, p->p_ucred, LEASE_WRITE); + LEASE_CHECK(vp, + p, p->p_ucred, LEASE_WRITE); + error = VOP_LINK(nd.ni_dvp, vp, &nd.ni_cnd); } } } |