mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 00:22:00 +02:00
netfs: Fix netfs_read_folio() to wait on writeback
Fix netfs_read_folio() to wait for an ongoing writeback to complete so that
it can trust the dirty flag and whatever is attached to folio->private
(folio->private may get cleaned up by the collector before it clears the
writeback flag).
Fixes: ee4cdf7ba8 ("netfs: Speed up buffered reading")
Closes: https://sashiko.dev/#/patchset/20260414082004.3756080-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://patch.msgid.link/20260512123404.719402-23-dhowells@redhat.com
cc: Paulo Alcantara <pc@manguebit.org>
cc: Matthew Wilcox <willy@infradead.org>
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
ccde2ac757
commit
ded0c6f160
|
|
@ -503,6 +503,8 @@ int netfs_read_folio(struct file *file, struct folio *folio)
|
|||
struct netfs_inode *ctx = netfs_inode(mapping->host);
|
||||
int ret;
|
||||
|
||||
folio_wait_writeback(folio);
|
||||
|
||||
if (folio_test_dirty(folio))
|
||||
return netfs_read_gaps(file, folio);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user