]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
NFSv4.x: Remove hard coded slotids in callback channel
authorTrond Myklebust <trond.myklebust@primarydata.com>
Sat, 23 Jan 2016 19:12:52 +0000 (14:12 -0500)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Sun, 24 Jan 2016 22:12:47 +0000 (17:12 -0500)
Instead, use the values encoded in the slot table itself.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/callback_proc.c
fs/nfs/nfs4proc.c

index f0939d097406a21b3f77d3ad2b8eec96807fa39c..83a66a8f40f2c5abeff7f40e0e0530c412635543 100644 (file)
@@ -361,7 +361,7 @@ validate_seqid(struct nfs4_slot_table *tbl, struct cb_sequenceargs * args)
        dprintk("%s enter. slotid %u seqid %u\n",
                __func__, args->csa_slotid, args->csa_sequenceid);
 
-       if (args->csa_slotid >= NFS41_BC_MAX_CALLBACKS)
+       if (args->csa_slotid > tbl->server_highest_slotid)
                return htonl(NFS4ERR_BADSLOT);
 
        slot = tbl->slots + args->csa_slotid;
@@ -489,8 +489,8 @@ __be32 nfs4_callback_sequence(struct cb_sequenceargs *args,
               sizeof(res->csr_sessionid));
        res->csr_sequenceid = args->csa_sequenceid;
        res->csr_slotid = args->csa_slotid;
-       res->csr_highestslotid = NFS41_BC_MAX_CALLBACKS - 1;
-       res->csr_target_highestslotid = NFS41_BC_MAX_CALLBACKS - 1;
+       res->csr_highestslotid = tbl->server_highest_slotid;
+       res->csr_target_highestslotid = tbl->target_highest_slotid;
 
        status = validate_seqid(tbl, args);
        if (status)
index 4bfc33ad05637f58f9f0b675f058fd90085d4271..be685e236bd53b6f6644f77c41e6b170c46a7858 100644 (file)
@@ -7319,7 +7319,7 @@ static void nfs4_init_channel_attrs(struct nfs41_create_session_args *args)
        args->bc_attrs.max_resp_sz = PAGE_SIZE;
        args->bc_attrs.max_resp_sz_cached = 0;
        args->bc_attrs.max_ops = NFS4_MAX_BACK_CHANNEL_OPS;
-       args->bc_attrs.max_reqs = 1;
+       args->bc_attrs.max_reqs = NFS41_BC_MAX_CALLBACKS;
 
        dprintk("%s: Back Channel : max_rqst_sz=%u max_resp_sz=%u "
                "max_resp_sz_cached=%u max_ops=%u max_reqs=%u\n",