Skip to content

Commit

Permalink
NFS: Fix a page leak in nfs_destroy_unlinked_subrequests()
Browse files Browse the repository at this point in the history
When we detach a subrequest from the list, we must also release the
reference it holds to the parent.

Fixes: 5b2b518 ("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>
  • Loading branch information
Trond Myklebust committed Apr 1, 2020
1 parent f764a1e commit add42de
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/nfs/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit add42de

Please sign in to comment.