diff options
author | julian <julian@FreeBSD.org> | 1998-06-08 23:55:33 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1998-06-08 23:55:33 +0000 |
commit | b4e8c144c14626f03c74f5cf185bb5eabe43c1ed (patch) | |
tree | a30b0046270351dc838731de3d84cc14816dcfdc /sys/ufs | |
parent | ca271071fdfbf54392c62f57307beb2c16e01332 (diff) | |
download | FreeBSD-src-b4e8c144c14626f03c74f5cf185bb5eabe43c1ed.zip FreeBSD-src-b4e8c144c14626f03c74f5cf185bb5eabe43c1ed.tar.gz |
The version of the softdep changes in FreeBSD broke the
(doingdirectory && !newparent) case of ufs_rename().
rename("D1/X/", "D2/Y/") gives a wrong link count for D2.
Submitted by: Bruce Evans <bde@zeta.org.au>
Reviewed by: Kirk McKusick <mckusick@McKusick.COM>
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ufs/ufs_vnops.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index b21c990..647576c 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.27 (Berkeley) 5/27/95 - * $Id: ufs_vnops.c,v 1.86 1998/06/07 10:49:18 bde Exp $ + * $Id: ufs_vnops.c,v 1.87 1998/06/07 11:04:26 bde Exp $ */ #include "opt_quota.h" @@ -1143,8 +1143,10 @@ abortit: if (error) goto bad; if (doingdirectory) { - dp->i_effnlink--; - dp->i_flag |= IN_CHANGE; + if (!newparent) { + dp->i_effnlink--; + dp->i_flag |= IN_CHANGE; + } xp->i_effnlink--; xp->i_flag |= IN_CHANGE; } @@ -1161,7 +1163,8 @@ abortit: * disk, so when running with that code we avoid doing * them now. */ - dp->i_nlink--; + if (!newparent) + dp->i_nlink--; xp->i_nlink--; if ((error = UFS_TRUNCATE(tvp, (off_t)0, IO_SYNC, tcnp->cn_cred, tcnp->cn_proc)) != 0) |