nfs41: fix nfs4_callback_recallslot
authorAndy Adamson <andros@netapp.com>
Thu, 21 Jan 2010 19:19:16 +0000 (14:19 -0500)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 10 Feb 2010 13:31:00 +0000 (08:31 -0500)
Return NFS4_OK if target high slotid equals enforced high slotid.
Fix nfs_client reference leak.

Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/callback_proc.c

index e5155d9df595edfc25e2ab5d184a13daec38c467..c79e18cd0e15142692328eeea52d317a86608369 100644 (file)
@@ -381,13 +381,17 @@ unsigned nfs4_callback_recallslot(struct cb_recallslotargs *args, void *dummy)
        fc_tbl = &clp->cl_session->fc_slot_table;
 
        status = htonl(NFS4ERR_BAD_HIGH_SLOT);
-       if (args->crsa_target_max_slots >= fc_tbl->max_slots ||
+       if (args->crsa_target_max_slots > fc_tbl->max_slots ||
            args->crsa_target_max_slots < 1)
-               goto out;
+               goto out_putclient;
+
+       status = htonl(NFS4_OK);
+       if (args->crsa_target_max_slots == fc_tbl->max_slots)
+               goto out_putclient;
 
        fc_tbl->target_max_slots = args->crsa_target_max_slots;
        nfs41_handle_recall_slot(clp);
-       status = htonl(NFS4_OK);
+out_putclient:
        nfs_put_client(clp);    /* balance nfs_find_client */
 out:
        dprintk("%s: exit with status = %d\n", __func__, ntohl(status));