]> git.baikalelectronics.ru Git - kernel.git/commitdiff
NFS: Fix a request reference leak in nfs_direct_write_clear_reqs()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 31 Mar 2020 00:13:48 +0000 (20:13 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 1 Apr 2020 17:37:56 +0000 (13:37 -0400)
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: 8ac208398560 ("NFS: commit errors should be fatal")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/direct.c

index 51ab4627c4d6688afbaf631ef84a8fd61499cfb5..8074304fd5b4571558ebb344f1d47dea68baf03e 100644 (file)
@@ -646,6 +646,7 @@ static void nfs_direct_write_clear_reqs(struct nfs_direct_req *dreq)
        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);
        }
 }