在 2024/11/12 16:36, Christoph Hellwig 写道:
On Tue, Nov 12, 2024 at 04:33:56PM +1030, Qu Wenruo wrote:
IIRC it's related to the get_user_page() shenanigans but not 100% sure.
While there might be a few stragglers left, everyone should be using
pin_user_pages when manipulating page contents. The long tolerated
just pin and mark dirty is officially a bug now.
Great to know that.
I'm talking about the iomap_set_range_dirty() call inside
iomap_writepage_map(), for the "if (i_blocks_per_folio() > 1)" branch.
That does not set the page dirty. It propagatates the per-folio
dirty state into the per-block dirty bitmap allocated in the line
above.
I know, I just want to say it's marking the whole folio to be written back.
And in that out-of-band case, shouldn't we error out now instead of
marking the range to be written back?
Especially such out-of-band folio is unstable and can lead to other
problems, like content change halfway and causing csum mismatch.
And if that's the case, I think it will be much easier for btrfs to get
rid of its cow fixup workaround.
Thanks,
Qu