summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2020-04-01 10:07:16 -0400
committerTrond Myklebust <trond.myklebust@hammerspace.com>2020-04-01 10:11:22 -0400
commitadd42de31721fa29ed77a7ce388674d69f9d31a4 (patch)
treed2a9b82eda0f38418cacec7e2fe7d742fcb502b6 /fs
parentf764a1e1cb8bb3de42ca31abd034bdb82f156c29 (diff)
downloadlwn-add42de31721fa29ed77a7ce388674d69f9d31a4.tar.gz
lwn-add42de31721fa29ed77a7ce388674d69f9d31a4.zip
NFS: Fix a page leak in nfs_destroy_unlinked_subrequests()
When we detach a subrequest from the list, we must also release the reference it holds to the parent. Fixes: 5b2b5187fa85 ("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>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/write.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 03b7f64f7c4f..626e99cbb50e 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -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);