]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 4.19
authorSasha Levin <sashal@kernel.org>
Mon, 30 Oct 2023 21:13:05 +0000 (17:13 -0400)
committerSasha Levin <sashal@kernel.org>
Mon, 30 Oct 2023 21:13:05 +0000 (17:13 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.19/nfs-don-t-call-generic_error_remove_page-while-holdi.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/nfs-don-t-call-generic_error_remove_page-while-holdi.patch b/queue-4.19/nfs-don-t-call-generic_error_remove_page-while-holdi.patch
new file mode 100644 (file)
index 0000000..2779be7
--- /dev/null
@@ -0,0 +1,38 @@
+From 21ea79c63b30a70b86f37f44c38d17fcf62dbc69 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 7 Apr 2019 13:59:03 -0400
+Subject: NFS: Don't call generic_error_remove_page() while holding locks
+
+From: Trond Myklebust <trondmy@gmail.com>
+
+[ 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@hammerspace.com>
+Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/nfs/write.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/fs/nfs/write.c b/fs/nfs/write.c
+index ec0fd6b3d185a..65aaa6eaad2c1 100644
+--- a/fs/nfs/write.c
++++ b/fs/nfs/write.c
+@@ -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);
+ }
+-- 
+2.42.0
+
index c4bb7849f446f2e7226ecc5481d5e3a0a7cad218..63ecdd921a707088a5dbcc179c2ce8b97d656cd8 100644 (file)
@@ -24,3 +24,4 @@ acpica-add-support-for-madt-online-enabled-bit.patch
 x86-acpi-don-t-add-cpus-that-are-not-online-capable.patch
 x86-acpi-boot-use-fadt-version-to-check-support-for-.patch
 x86-i8259-skip-probing-when-acpi-madt-advertises-pca.patch
+nfs-don-t-call-generic_error_remove_page-while-holdi.patch