From nobody Tue Jan 11 18:14:57 2022 X-Original-To: dev-commits-src-branches@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 3EC93193EF7E; Tue, 11 Jan 2022 18:14:58 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JYJkn6yN1z4RPf; Tue, 11 Jan 2022 18:14:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEA361DC2C; Tue, 11 Jan 2022 18:14:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20BIEvAd099896; Tue, 11 Jan 2022 18:14:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20BIEvhr099895; Tue, 11 Jan 2022 18:14:57 GMT (envelope-from git) Date: Tue, 11 Jan 2022 18:14:57 GMT Message-Id: <202201111814.20BIEvhr099895@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 3286a8dc8382 - releng/13.0 - fsck_ffs: fix bad inode number errors List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 3286a8dc83829bf183284290dd59f82ba389a066 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641924898; 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=LVwWEmdXIbfkHLXg8sr9x9OD6WJkVRiinRW+ZPzl48k=; b=RiC4bfPo9vPmHlv9gY4h2FnBqckBIuSL4ELNTB7Fr0O0ExP21KhHFHu7Fk9fKb9NGXWC1N zRGGV/xkxZk8+H2i9z4DHHipq+d2VdHW+k5Q8nJaX/dyqAHJMywwmmk/sBZz6Si4W/MOOy Q0n9Q71NDRvVSU1KMbj/8rreR+uUkbySEYc+kwHXphLI7Bjo65zsMAKt9O8ClS56yMKNnX HEvrai6W1qy72nmz7O6O2OZ1PGeatVpI8LQbkoP2FhPRN51tC7JYCUu0GG2/xC7ztFsrLs TLzhcsATFD9qIg/rSknLc2yvBu5p9y2zbMkNEqp4MgKAwc0/pgBh0aZ9++sJgg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1641924898; a=rsa-sha256; cv=none; b=t1sjvCNCVQa6dynjz3fSeqq3KkgNzsABQJn8kUaYZ+xUlOhMKSX1UKqaBTrh3+8t6qFW0O FLfrrk7sS08vX7iUohgpd7dgLI4bwpcZY2fjlH3KIrWBoJX7arUOooJZZd8LcfjNrN6nA9 0OxmexzqXdQvl7rEAtC8opB9sT6mOZ66hH9m+dH8aiDSzk6lBsRhy/SUrM/9QeXZQgnpWz Qx7fI8TiZsJ+oAfZU8hI5DgrEanZ7tTaQ1t8juy0aEpVJlHrBrrdq6KAxo2Sytq5fnGJTS O5vgfMDoj+jOHocmMIQ6hF8m2qqviu9N86hJUWUz0U8RVpP1QbaVratpX75MIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.0 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=3286a8dc83829bf183284290dd59f82ba389a066 commit 3286a8dc83829bf183284290dd59f82ba389a066 Author: Kirk McKusick AuthorDate: 2021-03-24 23:50:24 +0000 Commit: Ed Maste CommitDate: 2022-01-10 14:51:48 +0000 fsck_ffs: fix bad inode number errors Fix fsck_ffs Pass 1b error exit "bad inode number 2 to nextinode". (cherry picked from commit bc444e2ec6e6cc9d96d35ab7ce3c02c0da952fad) (cherry picked from commit fab7c18ce3229d53b732fdfdbb6e9a1a1c72739a) Fix fsck_ffs Pass 1b error exit "bad inode number 256 to nextinode". (cherry picked from commit fe815b88b553667c40353c46b58f9779efa3570e) PR: 255979 Sponsored by: Netflix (cherry picked from commit e198c1dc8f6faaa85bd20990d15e3bcb9d081873) Approved by: so Errata: FreeBSD-EN-22:01.fsck_ffs --- sbin/fsck_ffs/pass1b.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sbin/fsck_ffs/pass1b.c b/sbin/fsck_ffs/pass1b.c index 8c09ef36acad..17a3b6495dc4 100644 --- a/sbin/fsck_ffs/pass1b.c +++ b/sbin/fsck_ffs/pass1b.c @@ -60,7 +60,6 @@ pass1b(void) memset(&idesc, 0, sizeof(struct inodesc)); idesc.id_func = pass1bcheck; duphead = duplist; - inumber = 0; for (c = 0; c < sblock.fs_ncg; c++) { if (got_siginfo) { printf("%s: phase 1b: cyl group %d of %d (%d%%)\n", @@ -77,9 +76,12 @@ pass1b(void) if (inosused == 0) continue; setinodebuf(c, inosused); + inumber = c * sblock.fs_ipg; for (i = 0; i < inosused; i++, inumber++) { - if (inumber < UFS_ROOTINO) + if (inumber < UFS_ROOTINO) { + (void)getnextinode(inumber, 0); continue; + } dp = getnextinode(inumber, 0); idesc.id_number = inumber; idesc.id_type = inoinfo(inumber)->ino_idtype;