NFS: Don't call generic_error_remove_page() while holding locks

[ Upstream commit 22876f540b ]

The NFS read code can trigger writeback while holding the page lock.
If an error then triggers a call to nfs_write_error_remove_page(),
we can deadlock.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Trond Myklebust 2019-04-07 13:59:03 -04:00 committed by Greg Kroah-Hartman
parent ce7c6ad176
commit 13ab9909f3
1 changed files with 1 additions and 2 deletions

View File

@ -587,9 +587,8 @@ try_again:
static void nfs_write_error_remove_page(struct nfs_page *req)
{
SetPageError(req->wb_page);
nfs_end_page_writeback(req);
generic_error_remove_page(page_file_mapping(req->wb_page),
req->wb_page);
nfs_release_request(req);
}