Message ID | 20241216194051.34873-1-snitzer@kernel.org |
---|---|
State | New |
Headers | show |
Series | NFS: fix deadlock with pNFS flexfiles IO retry error path | expand |
ML cleanup. Email not threaded. ...Juerg > From: Trond Myklebust <trond.myklebust@hammerspace.com> > > BugLink: https://bugs.launchpad.net/bugs/2089410 > > commit 31545f4b7cdb6da6a0519120b8c96dc40f186aac upstream stable/linux-5.15.y. > > 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> > (cherry picked from commit 31545f4b7cdb6da6a0519120b8c96dc40f186aac) > Fixes: 7be7b3ca16a59 ("NFS: Ensure we immediately start writeback on rescheduled writes") > Link: https://lore.kernel.org/stable/2024112146-tiptoeing-available-c5fe@gregkh/T/ > Closes: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2089410 > Signed-off-by: Mike Snitzer <snitzer@hammerspace.com> > Signed-off-by: Mike Snitzer <snitzer@kernel.org> > --- > fs/nfs/write.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/fs/nfs/write.c b/fs/nfs/write.c > index 2e1c45344d1fd..00e11c6602fe4 100644 > --- a/fs/nfs/write.c > +++ b/fs/nfs/write.c > @@ -1437,8 +1437,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 = {
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 2e1c45344d1fd..00e11c6602fe4 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -1437,8 +1437,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 = {