]> git.baikalelectronics.ru Git - kernel.git/commitdiff
NFS: Fix a page leak in nfs_destroy_unlinked_subrequests()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 1 Apr 2020 14:07:16 +0000 (10:07 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 1 Apr 2020 14:11:22 +0000 (10:11 -0400)
When we detach a subrequest from the list, we must also release the
reference it holds to the parent.

Fixes: 2edafd787a4c ("NFS: Fix nfs_page_group_destroy() and nfs_lock_and_join_requests() race cases")
Cc: stable@vger.kernel.org # v4.14+
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/write.c

index 03b7f64f7c4fdd35f15273fc86c56a9264830811..626e99cbb50ea272ec62ffb2ee5f873aaa79e607 100644 (file)
@@ -444,6 +444,7 @@ nfs_destroy_unlinked_subrequests(struct nfs_page *destroy_list,
                }
 
                subreq->wb_head = subreq;
+               nfs_release_request(old_head);
 
                if (test_and_clear_bit(PG_INODE_REF, &subreq->wb_flags)) {
                        nfs_release_request(subreq);