This is a note to let you know that I've just added the patch titled netfs: Fix netfs_page_mkwrite() to flush conflicting data, not wait to the 6.9-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_page_mkwrite-to-flush-conflicting-da.patch and it can be found in the queue-6.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 2872b117b9a2d5c218d2cd1031d8e4c4c7843746 Author: David Howells <dhowells@xxxxxxxxxx> Date: Mon Jun 24 12:24:03 2024 +0100 netfs: Fix netfs_page_mkwrite() to flush conflicting data, not wait [ Upstream commit 9d66154f73b7c7007c3be1113dfb50b99b791f8f ] Fix netfs_page_mkwrite() to use filemap_fdatawrite_range(), not filemap_fdatawait_range() to flush conflicting data. Fixes: 102a7e2c598c ("netfs: Allow buffered shared-writeable mmap through netfs_page_mkwrite()") Signed-off-by: David Howells <dhowells@xxxxxxxxxx> Link: https://lore.kernel.org/r/614300.1719228243@xxxxxxxxxxxxxxxxxxxxxx cc: Matthew Wilcox <willy@xxxxxxxxxxxxx> cc: Jeff Layton <jlayton@xxxxxxxxxx> cc: netfs@xxxxxxxxxxxxxxx cc: v9fs@xxxxxxxxxxxxxxx cc: linux-afs@xxxxxxxxxxxxxxxxxxx cc: linux-cifs@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/buffered_write.c b/fs/netfs/buffered_write.c index 72e4fa233c526..d2ce0849bb53d 100644 --- a/fs/netfs/buffered_write.c +++ b/fs/netfs/buffered_write.c @@ -535,9 +535,9 @@ vm_fault_t netfs_page_mkwrite(struct vm_fault *vmf, struct netfs_group *netfs_gr if (netfs_folio_group(folio) != netfs_group) { folio_unlock(folio); - err = filemap_fdatawait_range(mapping, - folio_pos(folio), - folio_pos(folio) + folio_size(folio)); + err = filemap_fdatawrite_range(mapping, + folio_pos(folio), + folio_pos(folio) + folio_size(folio)); switch (err) { case 0: ret = VM_FAULT_RETRY;