From nobody Fri Oct 20 22:16:02 2023 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 4SBzSM10Nlz4yHnp; Fri, 20 Oct 2023 22:16:03 +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 4SBzSM0M0Pz3FSk; Fri, 20 Oct 2023 22:16:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697840163; 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=U8/6I6yNFGPikmcEa1lG2+jposMVZlLS3vxT0fBO5/A=; b=SlXGUmweK066y4RX1tHySepIo3taNORJu9TlXJ0YyKoYjH7bihdbu0PAYrQ4k3tXqPrpZb Z9mQ7W5CPGeWTSl8PGEK018/x1CY9+SLUxVdn+vWCJB+dGDUpre5YlRKrLfvslr4vd5cuy 5csHnw4ivLpDaQtV/J6hF/wRHnhls/aj/zkr3MLQkDqefBWpTn49EpukPCpXAM4SuvYklt jQTXLUMbx7yVXrRBs0mKkqD5Et/rGO8vvaYFY5InG0xBKB/zGi2YHbNvaoW84+0k5ytjTv PZ41tjI6A4GgKUVyw6N68lWqXQqWpHa9aWtimSwuJV/z0gjMi5U7qBbjBryK7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697840163; a=rsa-sha256; cv=none; b=FJgotNoAZX3FAaEB2GV2/9U3O+vlLD+CS82m7Jfpr+/JETXXZKbdVIMlafbRBI4wougK0l cVm6rBQDZIGdh9yJjv7yijMS5KLR5xHozgQWnVugGYU/94I7ICD3bSCVp7WL7CS5Rah7D9 bBNJmVlyzrMW1o3BnXTIhCqzLl59xGo9pMCgGLz6XgAywsKnvx/1WeOmjO8eUDMpMF3qX6 oVOaZ6MM92pqogQLNPd/soM/cLMTZjsXDVIY5SGmjPHgis+sCgkv5KaW4rrsb4lBZbtzwA Bc8BGjdV7q17byJCNuUEpSJFjjDp/UBoBicsXYs+A1LljQlSfI54CeCbPj5C9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697840163; 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=U8/6I6yNFGPikmcEa1lG2+jposMVZlLS3vxT0fBO5/A=; b=GgFPSNAQ2RSverq75gzJVU6HNZlTZ0ZFKGAL6r3RgiaRpHKBn3eXWSHz6KgK1gy7ylvZsn jd2sdIMp1QMp7LiJaYF/TCEhpRQotND4HL+MSLMgSxtiGu6FgouDSJyoUTnFSJVgW3Dl9h 89K3crpbXw0HBVnCeuOa97M+Y/5O6iz3ynDbJ6AlJqMjDRun3qB6/7FVafsxgu8ubiOl2q RptEgv91pB/T/+Zhn571djjaUB6vUDkdF8lyjHoXh5BcqmMD7ReDRex5AzmVQLWQGCRO/U aKolQpjm2g78ngt6axcOoKdJ0R2e8YwYyYsUTlz2jRalgN8UO9g0MLEO0gEztw== 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 4SBzSL6Rtzzr2V; Fri, 20 Oct 2023 22:16:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 39KMG2oc056514; Fri, 20 Oct 2023 22:16:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39KMG2rO056511; Fri, 20 Oct 2023 22:16:02 GMT (envelope-from git) Date: Fri, 20 Oct 2023 22:16:02 GMT Message-Id: <202310202216.39KMG2rO056511@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: 1e39a0886e09 - main - Fix a bug in fsck_ffs(8) triggered by corrupted filesystems. 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1e39a0886e0999520a7e7136e3f7d09e9cd9a5f2 Auto-Submitted: auto-generated The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=1e39a0886e0999520a7e7136e3f7d09e9cd9a5f2 commit 1e39a0886e0999520a7e7136e3f7d09e9cd9a5f2 Author: Kirk McKusick AuthorDate: 2023-10-20 22:14:46 +0000 Commit: Kirk McKusick CommitDate: 2023-10-20 22:15:40 +0000 Fix a bug in fsck_ffs(8) triggered by corrupted filesystems. Add missing check for failed block read when checking information about a snapshot file. Reported-by: Andreas Bock PR: 274404 MFC-after: 1 week --- sbin/fsck_ffs/setup.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sbin/fsck_ffs/setup.c b/sbin/fsck_ffs/setup.c index 49e89f9221b0..d1d09d07b43a 100644 --- a/sbin/fsck_ffs/setup.c +++ b/sbin/fsck_ffs/setup.c @@ -299,6 +299,8 @@ checksnapinfo(struct inode *snapip) size = fragroundup(fs, DIP(snapip->i_dp, di_size) - lblktosize(fs, lbn)); bp = getdatablk(idesc.id_parent, size, BT_DATA); + if (bp->b_errs != 0) + return (0); snapblklist = (daddr_t *)bp->b_un.b_buf; /* * snapblklist[0] is the size of the list