linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netfs: Fix netfs_page_mkwrite() to flush conflicting data, not wait
@ 2024-06-24 11:24 David Howells
  2024-06-26 12:20 ` Christian Brauner
  0 siblings, 1 reply; 2+ messages in thread
From: David Howells @ 2024-06-24 11:24 UTC (permalink / raw)
  To: Christian Brauner, Matthew Wilcox
  Cc: dhowells, Jeff Layton, netfs, v9fs, linux-afs, linux-cifs,
	linux-mm, linux-fsdevel, linux-kernel

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@redhat.com>
cc: Matthew Wilcox <willy@infradead.org>
cc: Jeff Layton <jlayton@kernel.org>
cc: netfs@lists.linux.dev
cc: v9fs@lists.linux.dev
cc: linux-afs@lists.infradead.org
cc: linux-cifs@vger.kernel.org
cc: linux-mm@kvack.org
cc: linux-fsdevel@vger.kernel.org
---
 fs/netfs/buffered_write.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/netfs/buffered_write.c b/fs/netfs/buffered_write.c
index 05745bcc54c6..9cbbeeee6170 100644
--- a/fs/netfs/buffered_write.c
+++ b/fs/netfs/buffered_write.c
@@ -554,9 +554,9 @@ vm_fault_t netfs_page_mkwrite(struct vm_fault *vmf, struct netfs_group *netfs_gr
 	group = netfs_folio_group(folio);
 	if (group != netfs_group && group != NETFS_FOLIO_COPY_TO_CACHE) {
 		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;



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] netfs: Fix netfs_page_mkwrite() to flush conflicting data, not wait
  2024-06-24 11:24 [PATCH] netfs: Fix netfs_page_mkwrite() to flush conflicting data, not wait David Howells
@ 2024-06-26 12:20 ` Christian Brauner
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Brauner @ 2024-06-26 12:20 UTC (permalink / raw)
  To: David Howells
  Cc: Christian Brauner, Jeff Layton, netfs, v9fs, linux-afs,
	linux-cifs, linux-mm, linux-fsdevel, linux-kernel,
	Matthew Wilcox

On Mon, 24 Jun 2024 12:24:03 +0100, David Howells wrote:
> Fix netfs_page_mkwrite() to use filemap_fdatawrite_range(), not
> filemap_fdatawait_range() to flush conflicting data.
> 
> 

Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes

[1/1] netfs: Fix netfs_page_mkwrite() to flush conflicting data, not wait
      https://git.kernel.org/vfs/vfs/c/9d66154f73b7


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-26 12:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-24 11:24 [PATCH] netfs: Fix netfs_page_mkwrite() to flush conflicting data, not wait David Howells
2024-06-26 12:20 ` Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox