From nobody Sat May 09 04:57:27 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 4gCDHw3sMMz6cgHk for ; Sat, 09 May 2026 04:57:32 +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 4gCDHw2rqfz3sFn for ; Sat, 09 May 2026 04:57:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1778302652; 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=HJcDvZNznLPAx8aXc5e0O5B10bPbZa/p3eUkeCKroVo=; b=jXIBfcbSm4gIHu0jvuypaIXlmrUPg+MKPS0XyzBqeOBd7nWPOWL6sbn49T5UvhziYrTRtZ UX6NmTgW5yUqNsYFkUvZJuKqBfWc4MZRnGiTSOxzr5j9OzruwKRSAes7nvQSH1ZI83x8X0 cs+mCYoEPjWRUtDr9D18t7UFQqcNqx46hogp3qOhPsvHSgTNaEoI2y4rr6jCgQkoSY2ie0 J8t0dqjy2o119/X1FmY/dU4UFnyUih5AOchKm7fG698MzzuJkihTzdvSNZ4DuHbm3CjtGS f7GoB+O7h77f57PAzZkdxfBy/zo4b5iI51tcqphnBqw0Hj/v7LUVx3RtHhy4AA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1778302652; a=rsa-sha256; cv=none; b=SJloBuk3gKoBXo/CL8bzAriL/McwXo0KL0/vonnMTWePS0Km/LewkCIKgj4nBUr9MOrpyR K7DZYBOdwCfLMajMTgLe+3zySvV3Biig5GBeDYcKLg7VUkI1PFxJ7tn3HgtFeWT1IN3Onq XBHJOUhO5KTrwGjfVkhhmjBCVwIR55glYauHXlB9TEx2lJntftUj9sjplV3rdF80QkwFLc HzW5hZr9Z6MWt2sdP6fPgqjKPhhNROUxSMz50uuUEa9Wlz02Njj3ihipTEj3Ut9X0nHDMx HGMLWKEpAh3ZE4eLs2AQSc2CSjUI2KjoMBx2gIwv64azYB0igI1V+IUTX55IHg== 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=1778302652; 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=HJcDvZNznLPAx8aXc5e0O5B10bPbZa/p3eUkeCKroVo=; b=ZfGosSm7RjrQnIpAD0QUijATUVzGMXR9M0TU4xy2ddsKYUgoPvYe8+HL/5y/OjML6It1fk QNfcCmLXqGvov0N3fX37m3lHChnPA0dwD00FYEuxVRgDpcWy7gmePagHz+rGb8MkXuAxNT v8Qs3ZQpme8pZuRZnRaIOYlglQRZ4c4zJ7MtDxv6qEeAsiW4YLaV77Ss9M68B3z2x8oAaQ imLvfqDAO2YcBJlYtNEP0FtcxVn6o3n0/K1z8UjrKuzqtzEnlTm9tfSKlhpqOkBIOPMLfu olZLA5HCxcA4hskBpOLO3nfCGskOqCLTg7kkn0hjxDB6Omt//mJcHUhz3rlIzA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gCDHw1pGVzldJ for ; Sat, 09 May 2026 04:57:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3749a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 09 May 2026 04:57:27 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Lianwei Wang From: Xin LI Subject: git: 10e342c1ec78 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 10e342c1ec78af5a0b97739c806b16a632118fa5 Auto-Submitted: auto-generated Date: Sat, 09 May 2026 04:57:27 +0000 Message-Id: <69febeb7.3749a.5499531@gitrepo.freebsd.org> The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=10e342c1ec78af5a0b97739c806b16a632118fa5 commit 10e342c1ec78af5a0b97739c806b16a632118fa5 Author: Lianwei Wang AuthorDate: 2026-05-09 04:56:12 +0000 Commit: Xin LI CommitDate: 2026-05-09 04:56:12 +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 MFC after: 3 days --- 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; } } }