From nobody Tue May 12 05:16:14 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 4gF4ZD2fk6z6d2vD for ; Tue, 12 May 2026 05:16:20 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gF4ZC6kL7z3lvR for ; Tue, 12 May 2026 05:16:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1778562980; 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=YNdJ/cOP0aL93twws1FB/Jl6MhBUQ+57afngCahteUU=; b=OOZOoMmKlGW7a1o35vlhFY0iijXKtU2RVfdQQe7QvBESjdae0fVQTXXaKVVq7TJnZUDyfe NmNcC1z80WjU4sn6UZpzeBLHdDsHNQwGriN/yq5rBLmnlSquYzPGwZ+fEBYfiFrh4vmV4s SBwsWetI9fIgWU8xIy8QIDhn27hv4PDwpn0uPYBbSKRs9TRRggrrsyoxZPWMWGIENB361+ lnlO3oZAoLphQvmJt+RiAJFdD3K7shFENyzXlr8B7Zx0ZALJv16jlhnThv8yincv7ba5iZ ByxYt7QyDUAWNHgoZu0othT3EVTUBVg/BeoOys0etLkJH+yo/MhS9oJuk4mZHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1778562980; a=rsa-sha256; cv=none; b=HkI/RtXGuK/24lG9EvaA1IPh52uLjIQW/vBoj2LHH3bMbaqZ+pzXVJ9wh23rzbL2agrOaO 0WwfaCPeo+K4chxqHJ2z+rAbDYvXZ5dwh4UNI38GkcFBQCP14dN5/DDsoOaoVLHlz1ZiZ9 5zOv7fcror7mrO0wQdIdPSPw0j4bm3nVDBntviGGGOxeseEVgCHEApihF8s+0VmwLAijbL CwJoyqshBZkKQAqEPeIp0kwyCCxHU+TW0HzpDxrzw/UxoMLqS2O0ZCpEWAY65hMSTX9osh 8BGqEfd6AHEetct4xt8pQAPWgl/dh/54N0qNPjSoxBau+SzPA5r5ZVvTigHO1Q== 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=1778562980; 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=YNdJ/cOP0aL93twws1FB/Jl6MhBUQ+57afngCahteUU=; b=NtSeXqhmDVuSmwC7G+vmjU2Ez5VfDXyDFZJBeNsAoWiduQ3wh3tdcYw4B++9ExF/D/kjXv sZ6anRBdaST1ZRPABRAjhW/dogcU6Uppzfe0HBOSDzZRyW5lG7UTvg1YLYmyXU7x/7rBd6 wNfMEtv2NKHOeQKWawCKTFaIugAZCHksTtqxk2cTuvaTEh4bCDcUHYK1IMwaDTdgmcc5oa kc0Qz4EV0g3oj9LY6FoGEA607KT4rNYAAPUTIIrYLiszoJ/1LyRk9yhBz8W2wJ/NTDNoWz sLdTfC4p07s0w16ODR6vY2kyW32UFI/RFb2ru/K8Sebm3zR8rICAbS3WU7o7Eg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gF4ZC5shqzqM6 for ; Tue, 12 May 2026 05:16:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 426e3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 12 May 2026 05:16:14 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Lianwei Wang From: Xin LI Subject: git: ae32d61a2e3e - stable/15 - fsck_msdosfs: fix FAT header correction not persisting in cache mode 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/15 X-Git-Reftype: branch X-Git-Commit: ae32d61a2e3e47bed54d861893d8e2da90fb7c76 Auto-Submitted: auto-generated Date: Tue, 12 May 2026 05:16:14 +0000 Message-Id: <6a02b79e.426e3.32abb9a9@gitrepo.freebsd.org> The branch stable/15 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=ae32d61a2e3e47bed54d861893d8e2da90fb7c76 commit ae32d61a2e3e47bed54d861893d8e2da90fb7c76 Author: Lianwei Wang AuthorDate: 2026-05-09 04:56:12 +0000 Commit: Xin LI CommitDate: 2026-05-12 05:15:41 +0000 fsck_msdosfs: fix FAT header correction not persisting in cache mode When fsck_msdosfs runs with FAT32 cache mode (used for large filesystems that cannot be mmap'd), a detected FAT header correction was written into the in-memory buffer but the corresponding cache entry (fat32_cache_allentries[0]) was never marked dirty. As a result, fat_flush_fat32_cache_entry() skipped it, the corrected bytes were never written to disk, and copyfat() propagated the uncorrected on-disk data to all backup FAT copies. Every subsequent fsck run would repeat the same "FAT starts with odd byte sequence / FIXED" cycle indefinitely. Fix by marking fat32_cache_allentries[0].dirty = true after applying the in-memory correction, ensuring the chunk is flushed before copyfat() runs. Obtained from: https://android-review.googlesource.com/c/platform/external/fsck_msdos/+/4047981 (cherry picked from commit 10e342c1ec78af5a0b97739c806b16a632118fa5) --- sbin/fsck_msdosfs/fat.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sbin/fsck_msdosfs/fat.c b/sbin/fsck_msdosfs/fat.c index 567bfcd428cb..5ead0b1bf783 100644 --- a/sbin/fsck_msdosfs/fat.c +++ b/sbin/fsck_msdosfs/fat.c @@ -927,6 +927,17 @@ readfat(int fs, struct bootblock *boot, struct fat_descriptor **fp) default: break; } + /* + * In cache mode the header lives in + * fat32_cache_allentries[0]. Mark it + * dirty so it is flushed to disk (either + * on eviction or in writefat()) before + * copyfat() copies the primary FAT to + * backup copies. + */ + if (fat->use_cache) + fat->fat32_cache_allentries[0].dirty = + true; } } }