Skip to content

Commit

Permalink
NFS: Don't call generic_error_remove_page() while holding locks
Browse files Browse the repository at this point in the history
[ Upstream commit 22876f5 ]

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 <[email protected]>
Signed-off-by: Anna Schumaker <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
trondmy authored and gregkh committed Nov 8, 2023
1 parent c1a4390 commit fecb9d5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/nfs/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,9 +598,8 @@ nfs_lock_and_join_requests(struct page *page)

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);
}

Expand Down

0 comments on commit fecb9d5

Please sign in to comment.