Re: [PATCH v1 2/5] exfat: dirty all new pages when extending valid_size

From: Chi Zhiling

Date: Wed Sep 30 2026 - 02:17:22 EST


On 9/29/26 6:26 PM, Yuezhang.Mo@xxxxxxxx wrote:
+ if (folio->mapping == mapping) {
folio_mark_dirty(folio);
+ pos = next;

Setting 'pos' under this condition may result in an infinite loop.

If we set pos unconditionally, I'm concerned that we might miss marking a folio as dirty, which could expose stale data.

I think it would be better to switch to __filemap_get_folio() in the next version. It can directly return a locked folio, so we don't need to check whether the folio has been truncated.

folio = __filemap_get_folio(mapping, index, FGP_WRITEBEGIN, 0);


+ }
folio_unlock(folio);
folio_put(folio);
- pos = next;
}

return 0;