From b2258a1e7a6708a3085b9a8b80a1bad52cf90c1c Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mar 25 2024 01:19:20 +0000 Subject: NFS: Fix a request reference leak in nfs_direct_write_clear_reqs() (git-fixes). --- diff --git a/patches.suse/NFS-Fix-a-request-reference-leak-in-nfs_direct_write.patch b/patches.suse/NFS-Fix-a-request-reference-leak-in-nfs_direct_write.patch new file mode 100644 index 0000000..ceb2f7c --- /dev/null +++ b/patches.suse/NFS-Fix-a-request-reference-leak-in-nfs_direct_write.patch @@ -0,0 +1,30 @@ +From: Trond Myklebust +Date: Mon, 30 Mar 2020 20:13:48 -0400 +Subject: [PATCH] NFS: Fix a request reference leak in + nfs_direct_write_clear_reqs() +Git-commit: f02cec9d33e0069c11e58f97529c1d697255889d +Patch-mainline: v5.7 +References: git-fixes + +nfs_direct_write_scan_commit_list() will lock the request and bump +the reference count, but we also need to account for the reference +that was taken when we initially added the request to the commit list. + +Fixes: fb5f7f20cdb9 ("NFS: commit errors should be fatal") +Signed-off-by: Trond Myklebust +Acked-by: NeilBrown + +--- + fs/nfs/direct.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/fs/nfs/direct.c ++++ b/fs/nfs/direct.c +@@ -691,6 +691,7 @@ static void nfs_direct_write_clear_reqs( + while (!list_empty(&reqs)) { + req = nfs_list_entry(reqs.next); + nfs_list_remove_request(req); ++ nfs_release_request(req); + nfs_unlock_and_release_request(req); + } + } diff --git a/series.conf b/series.conf index 3debbb2..f03125a 100644 --- a/series.conf +++ b/series.conf @@ -56543,6 +56543,7 @@ patches.suse/NFS-direct.c-Fix-memory-leak-of-dreq-when-nfs_get_lo.patch patches.suse/NFS-commit-errors-should-be-fatal.patch patches.suse/NFS-Fix-O_DIRECT-commit-verifier-handling.patch + patches.suse/NFS-Fix-a-request-reference-leak-in-nfs_direct_write.patch patches.suse/NFS-Fix-memory-leaks-in-nfs_pageio_stop_mirroring.patch patches.suse/0001-mm-memory_hotplug.c-only-respect-mem-parameter-durin.patch patches.suse/include-linux-swapops-h-correct-guards-for-non_swap_entry.patch