Re: [PATCH v2] ntfs: mount read-only when mft records are smaller than the device block

From: Hyunchul Lee

Date: Mon Aug 24 2026 - 21:30:44 EST


2026년 8월 24일 (월) 오후 11:42, Dennis Tighe <dennis.tighe@xxxxxxxxx>님이 작성:
>
> An mft record is written with a single bio of exactly mft_record_size
> bytes. bio_unaligned() rejects a bio whose size is not a multiple of the
> device's logical block size, so on a volume whose mft records are smaller
> than that block no mft record can be written at all.
>
> On 512n and 512e drives this is a non-issue, since both report a 512-byte
> logical block and a 1k record is a clean multiple of it. On 4Kn drives the
> mft record (1k) is smaller than the 4k logical block, so every mft write
> fails. At the same time, other writes (like directory index entries) that
> are 4k will succeed leading references to unwritten mft records and a
> corruption situation.
>
> Reads are unaffected, so mount read-only rather than refusing outright,
> and refuse a later remount read-write for the same reason.
>
> This is a stopgap. Writing these volumes needs read-modify-write at the
> device's block size, which this does not implement.
>
> Assisted-by: Claude:claude-opus-5
> Signed-off-by: Dennis Tighe <dennis.tighe@xxxxxxxxx>

Looks good to me.

Reviewed-by: Hyunchul Lee <hyc.lee@xxxxxxxxx>

--
Thanks,
Hyunchul