]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
NFSv4: Fix a slot leak in nfs40_sequence_done
authorTrond Myklebust <trond.myklebust@primarydata.com>
Wed, 29 Jan 2014 17:12:15 +0000 (12:12 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Feb 2014 21:55:34 +0000 (13:55 -0800)
commit cab92c19821a814ecf5a5279e2699bf28e66caee upstream.

The check for whether or not we sent an RPC call in nfs40_sequence_done
is insufficient to decide whether or not we are holding a session slot,
and thus should not be used to decide when to free that slot.

This patch replaces the RPC_WAS_SENT() test with the correct test for
whether or not slot == NULL.

Cc: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/nfs4proc.c

index c81d5d3bb6e40f074cd43a01eaac275e07789cd3..96721814104c8efc8ade425f302f4dd8f6698d33 100644 (file)
@@ -539,7 +539,7 @@ static int nfs40_sequence_done(struct rpc_task *task,
        struct nfs4_slot *slot = res->sr_slot;
        struct nfs4_slot_table *tbl;
 
-       if (!RPC_WAS_SENT(task))
+       if (slot == NULL)
                goto out;
 
        tbl = slot->table;