From nobody Wed Sep 30 05:13:15 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4hvjqb6p3yz6tkxS for ; Wed, 30 Sep 2026 05:13:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hvjqb6B9Hz4H7Z for ; Wed, 30 Sep 2026 05:13:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790745195; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7zW51ncHltX2F8ERvHGmd3pYGDL5ztEVeONW2RQ5jb0=; b=b0bvlKSFOT5gceuvd1moOVQ5sK9G6sDQ6/jS3YX8BjA41r5CKkB5WQhiQr0Sd5JPaWftgS tHQOI/2kFw4jpWGibDxYV8+6tF86V+HCYVAjNzz2TeMH7iq1YSjWY8Yic7wMJ2am2y7Zos 8zGa6W+9DhnjzVOj4HqdlFsYmsf7Fq4zn8YfmrdDIUQ6RR7X4Yv1O2AI6eyTNHJUvVj1Jt LhaUTetkHb8LH8u+dSHW2AzQ+bbmlOXzAsgCMNh0bzxMV5JR3O6dXQQYuG2vErCTjeIB77 ykpj/AOmB4tWHB9wvKW+XveCIiZGQXPY0FE+pc2RpHkXt6mZeAFgRn817Gzd4w== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1790745195; b=NUPuiVtoMhCicH87Me0lnX9LUuFwU8Fc6yhFvkZvL+ETOxXRfn7BB/10w+Rn6qz9iWobq1 xps/kyM/pJeHKfpk5E9ZVtUBNMWzeEjGZT7BTMPt0dre/jQpq5FZp23Y2y1tbg0+Vr8v4l Tkw+uIzMW4p4Fb/Or6qsfntdTj/cZZqqwE/8uT9M8rJqA/qGnEB4Y3oyd8armyxoxMAluQ 1ZA8Z0v1Tp0N+qhnkzT0kEkjnHQnlpmxcHte9o71sm2iX2fh4+zPeNyrHzG6FpdB/K1u+X S6hRhq+/w73u2FP2hsCCo3a/s7NBQ7zxuM0amhYEWP8qKONygRu5x4xoPfUpuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790745195; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7zW51ncHltX2F8ERvHGmd3pYGDL5ztEVeONW2RQ5jb0=; b=l2FHl2EeNJ2y4Wtvkx2I+rFCSvbru51HmvWw05er1sYW8gk7JKGY0hLbIz9DU2FLEzzE+O 7PoQFokQ7edxCUsZWn5e/FCWoOrlCLnpKJtJTWkG2FlGtlBRtEd311BKulCoWl+0fZY4Fr v0Jq6E+n3KtB6GVVPa25VseN1yh41vcM7AuNYofg+op6E1G5zf1KqIXRM614FhkRrakN5C xsCOtMtpmtE6mNnGdL2jJsKL6g2AKKlTHE+g6tHoBA8sjCsbBqELpviQnGZ/IAtTb/6Id0 11A3YW8Yig4nARBAlBhKKcS9pwVQ2dOC+/uvA8rHgasob3G9aeyVrTe9R/azAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hvjqb5F3kzVfF for ; Wed, 30 Sep 2026 05:13:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3edc1 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 30 Sep 2026 05:13:15 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Maxim Sobolev Subject: git: a179e72489f8 - main - ufs: report a mismatched ".." in ufs_dirrewrite() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sobomax X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a179e72489f8601f37b9039c86d3f224c73b3d51 Auto-Submitted: auto-generated Date: Wed, 30 Sep 2026 05:13:15 +0000 Message-Id: <6abc9a6b.3edc1.5ab8a0de@gitrepo.freebsd.org> The branch main has been updated by sobomax: URL: https://cgit.FreeBSD.org/src/commit/?id=a179e72489f8601f37b9039c86d3f224c73b3d51 commit a179e72489f8601f37b9039c86d3f224c73b3d51 Author: Maxim Sobolev AuthorDate: 2026-09-30 05:11:10 +0000 Commit: Maxim Sobolev CommitDate: 2026-09-30 05:11:42 +0000 ufs: report a mismatched ".." in ufs_dirrewrite() When ufs_rename() moves a directory to a new parent and ufs_dirrewrite() fails to rewrite its ".." entry, it reports "bad dir ... rename: missing .. entry" whatever the error. ufs_dirrewrite() never finds a missing "..", though: it fails with EIDRM when the ".." entry names another inode than the expected one, and otherwise only when the directory block cannot be read or written. The latter happens for every directory rename in flight when the device goes away under a forcibly unmounted file system, and the log then fills with reports of directories that are intact on disk. Report the EIDRM case with ufs_dirbad() in ufs_dirrewrite() itself, so that all of its callers get the same diagnostic, and drop the report from ufs_rename(). Errors from the lower layers are not reported, as usual for an I/O initiator. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D60137 --- sys/ufs/ufs/ufs_lookup.c | 2 ++ sys/ufs/ufs/ufs_vnops.c | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index 419ec3de8572..216014a72d35 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -1246,6 +1246,8 @@ ufs_dirrewrite(struct inode *dp, struct inode *oip, ino_t newinum, int newtype, error = UFS_BLKATOFF(vdp, (off_t)I_OFFSET(dp), (char **)&ep, &bp); if (error == 0 && ep->d_namlen == 2 && ep->d_name[1] == '.' && ep->d_name[0] == '.' && ep->d_ino != oip->i_number) { + ufs_dirbad(dp, I_OFFSET(dp), + "rewrite: .. entry does not name the expected inode"); brelse(bp); error = EIDRM; } diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 3c79c8814085..aecb784ec46a 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1749,9 +1749,7 @@ relock: /* Journal must account for each new link. */ softdep_setup_dotdot_link(tdp, fip); SET_I_OFFSET(fip, mastertemplate.dot_reclen); - if (ufs_dirrewrite(fip, fdp, newparent, DT_DIR, 0) != 0) - ufs_dirbad(fip, mastertemplate.dot_reclen, - "rename: missing .. entry"); + (void)ufs_dirrewrite(fip, fdp, newparent, DT_DIR, 0); cache_purge(fdvp); } error = ufs_dirremove(fdvp, fip, fcnp->cn_flags, false);