aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2016-01-23 15:21:08 -0500
committerTrond Myklebust <trond.myklebust@primarydata.com>2016-01-24 17:12:48 -0500
commit80f9642724af5dfab7d330481fa22e07fde084da (patch)
tree306a826cf8894314b682a29c5b70673add769a38
parentf74a834a0e1b35e39e917a1a88a62817610ee20b (diff)
NFSv4.x: Enforce the ca_maxresponsesize_cached on the back channel
We have no duplicate reply cache, so we always set the back channel ca_maxresponsesize_cached to zero when negotiating the session. That means we should always error out as soon as we see the server set args->csa_cachethis. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
-rw-r--r--fs/nfs/callback_proc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
index e0844fdbd9ac..345df6309017 100644
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -381,9 +381,8 @@ validate_seqid(struct nfs4_slot_table *tbl, struct cb_sequenceargs * args)
381 if (args->csa_cachethis == 0) 381 if (args->csa_cachethis == 0)
382 return htonl(NFS4ERR_RETRY_UNCACHED_REP); 382 return htonl(NFS4ERR_RETRY_UNCACHED_REP);
383 383
384 /* The ca_maxresponsesize_cached is 0 with no DRC */ 384 /* Liar! We never allowed you to set csa_cachethis != 0 */
385 else if (args->csa_cachethis == 1) 385 return htonl(NFS4ERR_SEQ_FALSE_RETRY);
386 return htonl(NFS4ERR_REP_TOO_BIG_TO_CACHE);
387 } 386 }
388 387
389 /* Wraparound */ 388 /* Wraparound */
@@ -500,6 +499,10 @@ __be32 nfs4_callback_sequence(struct cb_sequenceargs *args,
500 499
501 cps->slotid = args->csa_slotid; 500 cps->slotid = args->csa_slotid;
502 501
502 /* The ca_maxresponsesize_cached is 0 with no DRC */
503 if (args->csa_cachethis != 0)
504 return htonl(NFS4ERR_REP_TOO_BIG_TO_CACHE);
505
503 /* 506 /*
504 * Check for pending referring calls. If a match is found, a 507 * Check for pending referring calls. If a match is found, a
505 * related callback was received before the response to the original 508 * related callback was received before the response to the original