aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2015-02-18 14:34:58 -0500
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-02-18 15:30:47 -0500
commitb1c0df5fadc917ba3724ae9fdfcc6f97db34736a (patch)
tree0f369742e4d930a2ae0de2bcd03373a47d7f0586 /fs
parent79969dd12e8756f64a999992c0536ccd91bf6e54 (diff)
NFSv4.1: Don't set up a backchannel if the server didn't agree to do so
If the server doesn't agree to out backchannel setup request, then don't set one up. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/callback_proc.c2
-rw-r--r--fs/nfs/nfs4proc.c7
-rw-r--r--fs/nfs/nfs4session.c2
3 files changed, 9 insertions, 2 deletions
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
index e36a9d78ea49..197806fb87ff 100644
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -427,6 +427,8 @@ __be32 nfs4_callback_sequence(struct cb_sequenceargs *args,
427 if (clp == NULL) 427 if (clp == NULL)
428 goto out; 428 goto out;
429 429
430 if (!(clp->cl_session->flags & SESSION4_BACK_CHAN))
431 goto out;
430 tbl = &clp->cl_session->bc_slot_table; 432 tbl = &clp->cl_session->bc_slot_table;
431 433
432 spin_lock(&tbl->slot_tbl_lock); 434 spin_lock(&tbl->slot_tbl_lock);
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 006bfa3da55b..59853797825c 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -7195,6 +7195,8 @@ static int nfs4_verify_back_channel_attrs(struct nfs41_create_session_args *args
7195 struct nfs4_channel_attrs *sent = &args->bc_attrs; 7195 struct nfs4_channel_attrs *sent = &args->bc_attrs;
7196 struct nfs4_channel_attrs *rcvd = &res->bc_attrs; 7196 struct nfs4_channel_attrs *rcvd = &res->bc_attrs;
7197 7197
7198 if (!(res->flags & SESSION4_BACK_CHAN))
7199 goto out;
7198 if (rcvd->max_rqst_sz > sent->max_rqst_sz) 7200 if (rcvd->max_rqst_sz > sent->max_rqst_sz)
7199 return -EINVAL; 7201 return -EINVAL;
7200 if (rcvd->max_resp_sz < sent->max_resp_sz) 7202 if (rcvd->max_resp_sz < sent->max_resp_sz)
@@ -7206,6 +7208,7 @@ static int nfs4_verify_back_channel_attrs(struct nfs41_create_session_args *args
7206 return -EINVAL; 7208 return -EINVAL;
7207 if (rcvd->max_reqs != sent->max_reqs) 7209 if (rcvd->max_reqs != sent->max_reqs)
7208 return -EINVAL; 7210 return -EINVAL;
7211out:
7209 return 0; 7212 return 0;
7210} 7213}
7211 7214
@@ -7226,7 +7229,9 @@ static void nfs4_update_session(struct nfs4_session *session,
7226 nfs4_copy_sessionid(&session->sess_id, &res->sessionid); 7229 nfs4_copy_sessionid(&session->sess_id, &res->sessionid);
7227 session->flags = res->flags; 7230 session->flags = res->flags;
7228 memcpy(&session->fc_attrs, &res->fc_attrs, sizeof(session->fc_attrs)); 7231 memcpy(&session->fc_attrs, &res->fc_attrs, sizeof(session->fc_attrs));
7229 memcpy(&session->bc_attrs, &res->bc_attrs, sizeof(session->bc_attrs)); 7232 if (res->flags & SESSION4_BACK_CHAN)
7233 memcpy(&session->bc_attrs, &res->bc_attrs,
7234 sizeof(session->bc_attrs));
7230} 7235}
7231 7236
7232static int _nfs4_proc_create_session(struct nfs_client *clp, 7237static int _nfs4_proc_create_session(struct nfs_client *clp,
diff --git a/fs/nfs/nfs4session.c b/fs/nfs/nfs4session.c
index e799dc3c3b1d..e23366effcfb 100644
--- a/fs/nfs/nfs4session.c
+++ b/fs/nfs/nfs4session.c
@@ -450,7 +450,7 @@ int nfs4_setup_session_slot_tables(struct nfs4_session *ses)
450 tbl = &ses->fc_slot_table; 450 tbl = &ses->fc_slot_table;
451 tbl->session = ses; 451 tbl->session = ses;
452 status = nfs4_realloc_slot_table(tbl, ses->fc_attrs.max_reqs, 1); 452 status = nfs4_realloc_slot_table(tbl, ses->fc_attrs.max_reqs, 1);
453 if (status) /* -ENOMEM */ 453 if (status || !(ses->flags & SESSION4_BACK_CHAN)) /* -ENOMEM */
454 return status; 454 return status;
455 /* Back channel */ 455 /* Back channel */
456 tbl = &ses->bc_slot_table; 456 tbl = &ses->bc_slot_table;