From nobody Sun Dec 04 05:34:27 2022 X-Original-To: dev-commits-src-all@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 4NPwNN0khJz4jN3g; Sun, 4 Dec 2022 05:34:28 +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 4NPwNN0CWvz4QbF; Sun, 4 Dec 2022 05:34:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670132068; 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=12k02EGf2F14onjz7h6gpUTxfytUvL9NSsVM/FjU9rw=; b=lJ4M1pL/2OAEoNyUrKEObHD/nQi8raKCFJBSOB3lCj17XdMVNzAOLhJlbVO8HQi8I/Na+9 mtrqWvsNV+We0s9ZBEeaCEnI2eW+MNCp4+yoDGTCcw2lgzwbjfCgkTLnHDmPqxGwXqjjkY 2KTiU8s8P/d7GGDAd1hfRWy4HIhGjZLW/lunXT3F0gZdCXfSwiUMEPGcyhTupzng79uEou 74rH//ybSMrEGn47hbY9mzFTk8uh0dm1A2tCpUQGD3bHyTJGwMB6BRiGWgcMBNipYqxNGi UStSdAlHmCJ8IunFVvOLu9s+kbSNiYqBn1ZKoLLcEbin8qAtY/7U2q9Frjmj8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670132068; 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=12k02EGf2F14onjz7h6gpUTxfytUvL9NSsVM/FjU9rw=; b=Yq7NRCZvDKV/1ROy6qgfbLDdUNZOS+DDz/7NEmUdrlhnBlSiaGUJjumXNlYwXMH+0fc3xP JLx495KlPRfftn1wOId7EDifMCHYuRFCjoM1xu4tLP/9+ogQPzYJUVKOHBdm0Ge+YU9ZfM Imikza13610JuH3Gvrj8XjAcJsQJRNRFjdc2i+rsleAMtKAxzyW2w8HTTKOV0TaNw3lJov cLG+pyQV/uT2UweSUGTMB7CEXSudm+x7L9XW1J1I1z9uJ2zQ62/xxzqsVGDk9QRMJq44+G 5sX8MIpKk+7I8Xl0LX7ovqIZNV8w18EBsYBY8PCad7rmD/tLZHWi/2FeLnbfpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1670132068; a=rsa-sha256; cv=none; b=bCRWehsGQfWhAtkVHnweYg4ZH1/4jByd/YAri+BOBfJev6JTIeBAr91T69Z7/rQHiYfbBE pPtC3yPyjTXiUb3nnkNo+i3J2dq2yegwHfPtakyKnsKTVK8B24j8Ep1S8W+AQE6Ft73mM2 iz2IfPfbCrBZz+IVF+R65eliID6lGFGldrVEixaJBiKk8cYUo3o5x+7raB91Th3OAGHjmX v6o9xtePrMLOl7Dwa6v9ISnigxmH72VTfbRnp/cKeW7BftEXHv4OByYotKwknEskp6XSuP /cey2Og6eQvQv0NOjhceHFIP3gyGXVfFwtHjq8uL4FTsvsFGwVsrbJ+v9eIL8g== 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 4NPwNM69t2z1MR7; Sun, 4 Dec 2022 05:34:27 +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 2B45YRMo058281; Sun, 4 Dec 2022 05:34:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2B45YRq3058280; Sun, 4 Dec 2022 05:34:27 GMT (envelope-from git) Date: Sun, 4 Dec 2022 05:34:27 GMT Message-Id: <202212040534.2B45YRq3058280@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: e15d8f238461 - main - Updates to UFS/FFS superblock integrity checks when reading a superblock. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: e15d8f238461de9bca1fa37cc4ef06d84a4edd4f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=e15d8f238461de9bca1fa37cc4ef06d84a4edd4f commit e15d8f238461de9bca1fa37cc4ef06d84a4edd4f Author: Kirk McKusick AuthorDate: 2022-12-04 05:33:09 +0000 Commit: Kirk McKusick CommitDate: 2022-12-04 05:33:59 +0000 Updates to UFS/FFS superblock integrity checks when reading a superblock. Minor optimization that makes semantics of check clearer. Sponsored by: The FreeBSD Foundation --- sys/ufs/ffs/ffs_subr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c index 67f4fcd92fd8..705f8c9c961d 100644 --- a/sys/ufs/ffs/ffs_subr.c +++ b/sys/ufs/ffs/ffs_subr.c @@ -407,7 +407,7 @@ validate_sblock(struct fs *fs, int flags) FCHK(powerof2(fs->fs_fsize), ==, 0, %jd); FCHK(fs->fs_sbsize, >, SBLOCKSIZE, %jd); FCHK(fs->fs_sbsize, <, (signed)sizeof(struct fs), %jd); - FCHK(fs->fs_sbsize % dbtob(1), !=, 0, %jd); + FCHK(fs->fs_sbsize % sectorsize, !=, 0, %jd); FCHK(fs->fs_fpg, <, 3 * fs->fs_frag, %jd); FCHK(fs->fs_ncg, <, 1, %jd); FCHK(fs->fs_fsbtodb, !=, ILOG2(fs->fs_fsize / sectorsize), %jd); @@ -505,7 +505,7 @@ validate_sblock(struct fs *fs, int flags) */ if (error) return (error); - FCHK(fs->fs_sbsize % dbtob(1), !=, 0, %jd); + FCHK(fs->fs_sbsize % sectorsize, !=, 0, %jd); FCHK(fs->fs_ipg % fs->fs_inopb, !=, 0, %jd); FCHK(fs->fs_sblkno, !=, roundup( howmany(fs->fs_sblockloc + SBLOCKSIZE, fs->fs_fsize),