Skip to contentSkip to conversation

NFS: nfs_async_write_reschedule_io must not recurse into the writeback code

PATCH New [email protected] 1 participant 1 message Aug 2, 2022

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 NFS: nfs_async_write_reschedule_io must not recurse into the writeback code

From: Trond Myklebust <[email protected]>

It is not safe to call filemap_fdatawrite_range() from nfs_async_write_reschedule_io(), since we're often calling from a page reclaim context. Just let fsync() redrive the writeback for us.

---
 fs/nfs/write.c | 2 --
 1 file changed, 2 deletions(-)
fs/nfs/write.c +0 -2
index 16d166bc4099..4adf2b488da1 100644
@@ -1444,8 +1444,6 @@ static void nfs_async_write_error(struct list_head *head, int error)
 static void nfs_async_write_reschedule_io(struct nfs_pgio_header *hdr)
 {
 	nfs_async_write_error(&hdr->pages, 0);
-	filemap_fdatawrite_range(hdr->inode->i_mapping, hdr->args.offset,
-			hdr->args.offset + hdr->args.count - 1);
 }
 
 static const struct nfs_pgio_completion_ops nfs_async_write_completion_ops = {
Signature · 1 line
2.37.1