From nobody Tue May 12 05:18:04 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 4gF4cK5MNrz6d2sY for ; Tue, 12 May 2026 05:18:09 +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 4gF4cK4p9qz3mQ8 for ; Tue, 12 May 2026 05:18:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1778563089; 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=od1hh4CfKm/1aaluInhBp5cQw3fA2h6OuXMcSAFea68=; b=YahZTgoboywZQsVilDQfWklqyB5v9s+RwlfDasc9Ye1nIxpK5FQ5WX624ggRzXb3tSI9Tc 2p3qArA+ofVnX0V+ildxV9tKaL2Y0qdH+jj9+of1rLRYFpO1qzlY3c3vmiBDz8ao+uLkXX Xf0XSOJ0YNtE6pmgGNlO422860UsnZYDO5Y9z0de7/HLsMAGLtuwdagYERA4Bj6THKnq+b nyCWAeo4eqU/Yk3uM3cDgUtSBQ0vRMBgCyzhOKuV7bA+7P+RzgimvZfSTVcvSCiADM6yP6 cP6CBmvEXq8zIb/oFw81QlW12PLJuGTGRliBATH3ovjx0ExDo8bDY3eEUj2JJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1778563089; a=rsa-sha256; cv=none; b=e0k5ssIlA438wiVYlxWtSbzepQY3KB2Rohbg4mGbj2y1kjzAa/NtWHubkaIdVKoZQPAMxo G4hO8gEq3EBFrHdUKDDTkW57+4HWFGuhIR2PgDtdlVKMcBRYJObCUJV5LB1M7DfiG3EcxR XUMhEiu4BRfqohq/009d+6O/XVReD3Bh+whmVt2a1fJDZA0PNDq1qMEwXAMnEwshkEEuF2 DNv5gP9wdPxbUxM7uXrTJVMDzKHnhOmWKPZHjmzICGm43ql1+aKbl2wunSPp0JQ/+zHemw NcEiDPD76hprDxaxrI1BCRsB8h2McqhhDXBfgFlAmKnRJ0mYYBV4rQVlABN14A== 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=1778563089; 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=od1hh4CfKm/1aaluInhBp5cQw3fA2h6OuXMcSAFea68=; b=Mhth1Swk/pI+rxHmypLfou7g0ThWnROIyHvXzZlv4aeWOl8tRCnmGpFequcs4s0uoc85WC A5+j+tHCS+wINYonSf4M2Fp63kRRyktw339yEI9ft08cI6kyy7WiUaAjlhy+4MwDdXxiIp 1Qedz9Pgvux0XNcuVmCJvKQutraH7kjJ7wnEbTjO5pr+ukDCBvB+j/GSk1wP2DqkyPyP1n 6713RFntdbY+JUsiPgaPVK0dQfhqZYHO4SWyMiOlcFyIT4O1nqnr/xn9CK+9VaKO+y1Dpc /MDOEArvp/M4gOZiBd5RB3ywr93qAo+asS3g17dsvPLamvH8cXl+hsX0y4CT+Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gF4cK4JQ1zqWl for ; Tue, 12 May 2026 05:18:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4390a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 12 May 2026 05:18:04 +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: 302545bcbc1c - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 302545bcbc1c81076123cb69a12a5514661972df Auto-Submitted: auto-generated Date: Tue, 12 May 2026 05:18:04 +0000 Message-Id: <6a02b80c.4390a.4a1f31dd@gitrepo.freebsd.org> The branch stable/14 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=302545bcbc1c81076123cb69a12a5514661972df commit 302545bcbc1c81076123cb69a12a5514661972df Author: Lianwei Wang AuthorDate: 2026-05-09 04:56:12 +0000 Commit: Xin LI CommitDate: 2026-05-12 05:17:53 +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; } } }