Patch "netfs: Fix netfs_release_folio() to say no if folio dirty" has been added to the 6.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    netfs: Fix netfs_release_folio() to say no if folio dirty

to the 6.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     netfs-fix-netfs_release_folio-to-say-no-if-folio-dir.patch
and it can be found in the queue-6.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 2733849992b8c3aa2eba07eee1ab3a43d794ad4e
Author: David Howells <dhowells@xxxxxxxxxx>
Date:   Fri Aug 23 21:08:11 2024 +0100

    netfs: Fix netfs_release_folio() to say no if folio dirty
    
    [ Upstream commit 7dfc8f0c6144c290dbeb01835a67e81b34dda8cd ]
    
    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: c1ec4d7c2e13 ("netfs: Provide invalidate_folio and release_folio calls")
    Signed-off-by: David Howells <dhowells@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240815090849.972355-1-kernel@xxxxxxxxxxxxxxxx/ [1]
    Link: https://lore.kernel.org/r/20240823200819.532106-4-dhowells@xxxxxxxxxx
    cc: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>
    cc: Pankaj Raghav <p.raghav@xxxxxxxxxxx>
    cc: Jeff Layton <jlayton@xxxxxxxxxx>
    cc: Marc Dionne <marc.dionne@xxxxxxxxxxxx>
    cc: linux-afs@xxxxxxxxxxxxxxxxxxx
    cc: netfs@xxxxxxxxxxxxxxx
    cc: linux-mm@xxxxxxxxx
    cc: linux-fsdevel@xxxxxxxxxxxxxxx
    Signed-off-by: Christian Brauner <brauner@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/netfs/misc.c b/fs/netfs/misc.c
index 607a1972f4563..21acf4b092a46 100644
--- a/fs/netfs/misc.c
+++ b/fs/netfs/misc.c
@@ -161,6 +161,9 @@ bool netfs_release_folio(struct folio *folio, gfp_t gfp)
 	struct netfs_inode *ctx = netfs_inode(folio_inode(folio));
 	unsigned long long end;
 
+	if (folio_test_dirty(folio))
+		return false;
+
 	end = folio_pos(folio) + folio_size(folio);
 	if (end > ctx->zero_point)
 		ctx->zero_point = end;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux