From nobody Fri Oct 02 05:06:02 2026 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 4hwxZR6gwlz6vKZC for ; Fri, 02 Oct 2026 05:06:07 +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 4hwxZR5rdZz4Jmr for ; Fri, 02 Oct 2026 05:06:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790917567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FUhtlHhamHo2Dn85qHLt7wKinkk7OBhyNv9k7Mo+vAA=; b=CfaXBuLfqbcpm8GxqnzXzBHycWWZtPNnfzcaul5L4qAYF5Wyawv9zjIjv+kgBAsYJCx1We jAeJ1z2guFD5FGATQFeseYkQkfHWrvbuNTPyZIOKcx3CDr9PQ+DuadCVQ5PV0CGxFkHnVN 8yyA3l9767i93mNU6fpCI0jA6QL/niWcb9wG7hBkfe/IuS+Az9+l9ffh/dH8jcZNUDT541 WLPfG+l4OYykpwvvpPVTnY09usiyWjoKKj+6eWLuz5GnDj0rEcgdiXHQaelsH/dMqA/BTV /uOAJ4u13NAocPq+Fyb8bfuVFg23rssnVkrHpjkORmuOXv2U8fYu02lnl8csIQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1790917567; b=tgy+40tZ/KGNPk2bGoddd5qHQn6qdMtxblf4XNvfQUyGxOZDIqQPrDZBQLONrvQr4sZ8ov zhV+Gv0Ae05Z8YeoqvKSO2JcleIpCYsPaaRrbrrQB6NnE4SNkQHp+F9tg6lnLf1QZVt2t1 fSBJn6sgFwARkOFBqLH6Efc4QKF/g+5c8YooeuWATcPZkcDtpXbzljzEM+HTQdOBvId3Pw ogmEGP7X9Jk1tjkbFi5m5owT3ZGJuT/HSzyBZIZ/ORiX1+n+TTmFNbwxKo+gw/ntZFDKeK AP0FAC2vQh8lMPTOWRVFDAekiaQtYRT0sDK2TLaZHz9RZONrkEr43+0DiWv2Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1790917567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FUhtlHhamHo2Dn85qHLt7wKinkk7OBhyNv9k7Mo+vAA=; b=D1YC2gzFoLc4bRfeSQgxlC7kELNDpSUY5tQ7GDdNntt+e0CEb8c3Yeo3n0WLcP6/ylwpbl 8Hr8puCD6el2kYzYNSeUSprQ/DpCRN7ENKVwTH3fm7+9USHKX3KND/nGPvU5QD1i0iK7/e Kg00SR/ADc9fexFcVwHpDM5+kafqQlkbd+JuhHuRs6LE4rXRH59uJ63edj27i8iJSZCbRx lYrfTXgI4hxRgtG22otOt1ZA4IwHgdINBRiklcrOaLQHswddLTzwEVQY9c0di4TCHH0FbR mySffmYoNDJP8iwnE5hxhdHsjwRg/CSjD4ioPLnYuVPozKiyAAotV7dB9euVzw== 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 4hwxZR4qHvz13VX for ; Fri, 02 Oct 2026 05:06:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1aa91 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 02 Oct 2026 05:06:02 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Yunheeee From: Xin LI Subject: git: ec3ebfaf9fd3 - stable/14 - MFC: fsck_msdosfs: fix head bitmap over-allocation on 32-bit platforms 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ec3ebfaf9fd37ab937141f6b4fca548b1c9173a3 Auto-Submitted: auto-generated Date: Fri, 02 Oct 2026 05:06:02 +0000 Message-Id: <6abf3bba.1aa91.7b970946@gitrepo.freebsd.org> The branch stable/14 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=ec3ebfaf9fd37ab937141f6b4fca548b1c9173a3 commit ec3ebfaf9fd37ab937141f6b4fca548b1c9173a3 Author: Yunheeee AuthorDate: 2026-09-26 03:10:04 +0000 Commit: Xin LI CommitDate: 2026-10-02 05:05:44 +0000 MFC: fsck_msdosfs: fix head bitmap over-allocation on 32-bit platforms bitmap_ctor() computed the allocation size as roundup2(bits, LONG_BIT) / (LONG_BIT / 8) The dividend is a count of bits, so converting it to bytes requires dividing by 8 (bits per byte), not by LONG_BIT / 8 (bytes per long). The two divisors happen to coincide on LP64, but on ILP32 platforms the head bitmap was allocated at twice the required size; for a FAT32 file system with close to 2^28 clusters, that is 64 MiB instead of 32 MiB. The extra half of the allocation was never accessed, so there is no functional change other than the reduced memory footprint. Pull Request: https://github.com/freebsd/freebsd-src/pull/2440 (cherry picked from commit 269002da453895fc935101afefeb02d2c7d10360) --- sbin/fsck_msdosfs/fat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/fsck_msdosfs/fat.c b/sbin/fsck_msdosfs/fat.c index 7d0ad9a595cf..ef788c9826a4 100644 --- a/sbin/fsck_msdosfs/fat.c +++ b/sbin/fsck_msdosfs/fat.c @@ -121,7 +121,7 @@ bitmap_count(long_bitmap_t *lbp) static int bitmap_ctor(long_bitmap_t *lbp, size_t bits, bool allone) { - size_t bitmap_size = roundup2(bits, LONG_BIT) / (LONG_BIT / 8); + size_t bitmap_size = roundup2(bits, LONG_BIT) / 8; free(lbp->map); lbp->map = calloc(1, bitmap_size);