[v2,20/28] NFS: Don't call generic_error_remove_page() while holding locks
diff mbox series

Message ID 20190329215948.107328-21-trond.myklebust@hammerspace.com
State New
Headers show
  • Fix up soft mounts for NFSv4.x
Related show

Commit Message

Trond Myklebust March 29, 2019, 9:59 p.m. UTC
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>
 fs/nfs/write.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff mbox series

diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 9198a23bb58b..64cf6a340ba6 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -584,9 +584,8 @@  nfs_lock_and_join_requests(struct page *page)
 static void nfs_write_error_remove_page(struct nfs_page *req)
+	SetPageError(req->wb_page);
-	generic_error_remove_page(page_file_mapping(req->wb_page),
-				  req->wb_page);