This is a note to let you know that I've just added the patch titled NFS: Don't call generic_error_remove_page() while holding locks to the 4.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: nfs-don-t-call-generic_error_remove_page-while-holdi.patch and it can be found in the queue-4.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit b53cd0a7877a5f25d319665afa1d91cc456945ee Author: Trond Myklebust <trondmy@xxxxxxxxx> Date: Sun Apr 7 13:59:03 2019 -0400 NFS: Don't call generic_error_remove_page() while holding locks [ Upstream commit 22876f540bdf19af9e4fca893ce02ba7ee65ebcc ] 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@xxxxxxxxxxxxxxx> Signed-off-by: Anna Schumaker <Anna.Schumaker@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 010733c8bdcd3..1b5791d5537a3 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -587,9 +587,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); }