]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
NFS: nfs_async_write_reschedule_io must not recurse into the writeback code
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 1 Aug 2022 18:16:51 +0000 (14:16 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 18:50:38 +0000 (19:50 +0100)
commit b1a28f2eb9ea7a5a1763fe53fe699aa0feae4231 upstream.

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.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/write.c

index 3d06bad2760da159a08ee19c9acbfd558ca155aa..bb401d37fe26666bbd623a2f4e9da2f9710294c3 100644 (file)
@@ -1422,8 +1422,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 = {