Skip to content

Commit 7dfc8f0

Browse files
dhowellsbrauner
authored andcommitted
netfs: Fix netfs_release_folio() to say no if folio dirty
Fix netfs_release_folio() to say no (ie. return false) if the folio is dirty (analogous with iomap's behaviour). Without this, it will say yes to the release of a dirty page by split_huge_page_to_list_to_order(), which will result in the loss of untruncated data in the folio. Without this, the generic/075 and generic/112 xfstests (both fsx-based tests) fail with minimum folio size patches applied[1]. Fixes: c1ec4d7 ("netfs: Provide invalidate_folio and release_folio calls") Signed-off-by: David Howells <[email protected]> Link: https://lore.kernel.org/r/[email protected]/ [1] Link: https://lore.kernel.org/r/[email protected] cc: Matthew Wilcox (Oracle) <[email protected]> cc: Pankaj Raghav <[email protected]> cc: Jeff Layton <[email protected]> cc: Marc Dionne <[email protected]> cc: [email protected] cc: [email protected] cc: [email protected] cc: [email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent a74ee0e commit 7dfc8f0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/netfs/misc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ bool netfs_release_folio(struct folio *folio, gfp_t gfp)
161161
struct netfs_inode *ctx = netfs_inode(folio_inode(folio));
162162
unsigned long long end;
163163

164+
if (folio_test_dirty(folio))
165+
return false;
166+
164167
end = folio_pos(folio) + folio_size(folio);
165168
if (end > ctx->zero_point)
166169
ctx->zero_point = end;

0 commit comments

Comments
 (0)