1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-05 12:56:08 +00:00

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>
This commit is contained in:
Julian Elischer 1998-06-08 23:55:33 +00:00
parent 2f52e46135
commit 3f2419f9e4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=36779

View File

@ -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 @@ ufs_rename(ap)
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 @@ ufs_rename(ap)
* 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)