Date: Wed, 13 Jul 2022 08:48:37 GMT From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: c41bc565749d - stable/13 - ufs_rename(): revert the bump of fvp nlink count in case of EMLINK for tdvp Message-ID: <202207130848.26D8mbl4001471@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c41bc565749dc2947ca1f719de5957b796db1553 commit c41bc565749dc2947ca1f719de5957b796db1553 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2022-07-04 10:28:49 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2022-07-13 08:38:01 +0000 ufs_rename(): revert the bump of fvp nlink count in case of EMLINK for tdvp (cherry picked from commit 513e1bbc739239c9479367b15e5f863a5f891d66) --- sys/ufs/ufs/ufs_vnops.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 06bde030d32f..35639957badb 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1575,17 +1575,17 @@ relock: * .. is rewritten below. */ if (tdp->i_nlink >= UFS_LINK_MAX) { - if (!DOINGSOFTDEP(tdvp) || - tdp->i_effnlink >= UFS_LINK_MAX) { - error = EMLINK; - goto unlockout; - } fip->i_effnlink--; fip->i_nlink--; DIP_SET(fip, i_nlink, fip->i_nlink); UFS_INODE_SET_FLAG(fip, IN_CHANGE); if (DOINGSOFTDEP(fvp)) softdep_revert_link(tdp, fip); + if (!DOINGSOFTDEP(tdvp) || + tdp->i_effnlink >= UFS_LINK_MAX) { + error = EMLINK; + goto unlockout; + } MPASS(want_seqc_end); if (tvp != NULL) vn_seqc_write_end(tvp);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202207130848.26D8mbl4001471>