Re: [PATCH v3] exfat: validate cached iomaps during buffered writes and writeback

From: Namjae Jeon

Date: Fri Jul 03 2026 - 00:45:46 EST


On Thu, Jul 2, 2026 at 10:31 PM Chi Zhiling <chizhiling@xxxxxxx> wrote:
>
> On 7/2/26 8:54 PM, Namjae Jeon wrote:
> > On Thu, Jul 2, 2026 at 11:45 AM Chi Zhiling <chizhiling@xxxxxxx> wrote:
> >>
> >> From: Chi Zhiling <chizhiling@xxxxxxxxxx>
> >>
> >> Writeback does not hold i_rwsem and can race with truncate or other
> >> operations that change the file's block mapping. This may leave cached
> >> iomaps stale, causing writeback to write data to blocks that no longer
> >> belong to the file.
> > Do you have an actual reproducer or an observed corruption for this ?
> > Thanks.
>
> I haven't actually observed any data corruption, and I haven't been able
> to reproduce the issue.
>
> I just checked the code again, and it seems this issue cannot actually
> occur. The reason is that no operation other than truncate can modify
> the block mapping, and truncate waits for page reclaim to complete
> before releasing it.
>
> Sorry for taking up your time, and thank you very much for your help :)
No problem at all, Thank you for checking again and confirming that
there is no issue.