On Wed, Jun 23, 2021 at 07:51:18PM +0100, Matthew Wilcox wrote: > But truncate_inode_pages_range() is also called by, for example, > truncate(). In that case, nobody calls filemap_write_and_wait_range(), > so we can't discard the page because it might still be dirty. > Is that an acceptable way to choose behaviour -- if the split fails, > discard the page if it's clean and keep it if it's dirty? I'll > put a great big comment on it, because it's not entirely obvious. It seems to be working ... if (!folio_multi(folio)) return true; // if (split_huge_page(&folio->page) == 0) // return true; if (folio_dirty(folio)) return false; truncate_inode_folio(mapping, folio); return true; No additional xfstests failures from commenting out those two lines.