diff options
author | julian <julian@FreeBSD.org> | 1995-09-09 01:43:49 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1995-09-09 01:43:49 +0000 |
commit | b621bdb82560ba416ec34ef1b3eba16ee6a733ec (patch) | |
tree | 4b090f50f4991c2c6f3f9e002a8c9b31592973c0 /sys/ufs | |
parent | 986656d2a299d3d7992763611771f8e4b254f328 (diff) | |
download | FreeBSD-src-b621bdb82560ba416ec34ef1b3eba16ee6a733ec.zip FreeBSD-src-b621bdb82560ba416ec34ef1b3eba16ee6a733ec.tar.gz |
Obtained from:4.4lite2
fix a change where a shortcut resulted in teh wrong answer..
e.g.
touch a
touch b
mv a b
resulted in b being removed and a being moved to b
in the shortcut..
touch a
ln a b
mv a b
the wrong link was removed..
leaving a instead of b, giving a different result to when
both files were separate.
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ufs/ufs_vnops.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 3622004..d99c713 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)ufs_vnops.c 8.10 (Berkeley) 4/1/94 - * $Id: ufs_vnops.c,v 1.27 1995/08/28 09:19:17 julian Exp $ + * $Id: ufs_vnops.c,v 1.28 1995/09/04 00:21:11 dyson Exp $ */ #include <sys/param.h> @@ -808,18 +808,22 @@ abortit: error = EINVAL; goto abortit; } - VOP_ABORTOP(fdvp, fcnp); - vrele(fdvp); - vrele(fvp); + + /* Release destination completely. */ + VOP_ABORTOP(tdvp, tcnp); vput(tdvp); vput(tvp); - tcnp->cn_flags &= ~MODMASK; - tcnp->cn_flags |= LOCKPARENT | LOCKLEAF; - if ((tcnp->cn_flags & SAVESTART) == 0) + + /* Delete source. */ + vrele(fdvp); + vrele(fvp); + fcnp->cn_flags &= ~MODMASK; + fcnp->cn_flags |= LOCKPARENT | LOCKLEAF; + if ((fcnp->cn_flags & SAVESTART) == 0) panic("ufs_rename: lost from startdir"); - tcnp->cn_nameiop = DELETE; - (void) relookup(tdvp, &tvp, tcnp); - return (VOP_REMOVE(tdvp, tvp, tcnp)); + fcnp->cn_nameiop = DELETE; + (void) relookup(fdvp, &fvp, fcnp); + return (VOP_REMOVE(fdvp, fvp, fcnp)); } error = VOP_LOCK(fvp); if (error) |