aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/nfs4state.c29
-rw-r--r--fs/nfsd/state.h1
2 files changed, 15 insertions, 15 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 7f1282859cd6..db5d8c8537ed 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -771,6 +771,19 @@ static __be32 alloc_init_session(struct svc_rqst *rqstp, struct nfs4_client *clp
771 free_session(&new->se_ref); 771 free_session(&new->se_ref);
772 return nfserr_jukebox; 772 return nfserr_jukebox;
773 } 773 }
774 if (!clp->cl_cb_session && (cses->flags & SESSION4_BACK_CHAN)) {
775 struct sockaddr *sa = svc_addr(rqstp);
776
777 clp->cl_cb_session = new;
778 clp->cl_cb_conn.cb_xprt = rqstp->rq_xprt;
779 svc_xprt_get(rqstp->rq_xprt);
780 rpc_copy_addr((struct sockaddr *)&clp->cl_cb_conn.cb_addr, sa);
781 clp->cl_cb_conn.cb_addrlen = svc_addr_len(sa);
782 clp->cl_cb_conn.cb_minorversion = 1;
783 clp->cl_cb_conn.cb_prog = cses->callback_prog;
784 clp->cl_cb_seq_nr = 1;
785 nfsd4_probe_callback(clp, &clp->cl_cb_conn);
786 }
774 return nfs_ok; 787 return nfs_ok;
775} 788}
776 789
@@ -1045,7 +1058,7 @@ static struct nfs4_client *create_client(struct xdr_netobj name, char *recdir,
1045 clp->cl_flavor = rqstp->rq_flavor; 1058 clp->cl_flavor = rqstp->rq_flavor;
1046 copy_cred(&clp->cl_cred, &rqstp->rq_cred); 1059 copy_cred(&clp->cl_cred, &rqstp->rq_cred);
1047 gen_confirm(clp); 1060 gen_confirm(clp);
1048 1061 clp->cl_cb_session = NULL;
1049 return clp; 1062 return clp;
1050} 1063}
1051 1064
@@ -1515,20 +1528,6 @@ nfsd4_create_session(struct svc_rqst *rqstp,
1515 1528
1516 cs_slot->sl_seqid++; /* from 0 to 1 */ 1529 cs_slot->sl_seqid++; /* from 0 to 1 */
1517 move_to_confirmed(unconf); 1530 move_to_confirmed(unconf);
1518
1519 if (cr_ses->flags & SESSION4_BACK_CHAN) {
1520 unconf->cl_cb_conn.cb_xprt = rqstp->rq_xprt;
1521 svc_xprt_get(rqstp->rq_xprt);
1522 rpc_copy_addr(
1523 (struct sockaddr *)&unconf->cl_cb_conn.cb_addr,
1524 sa);
1525 unconf->cl_cb_conn.cb_addrlen = svc_addr_len(sa);
1526 unconf->cl_cb_conn.cb_minorversion =
1527 cstate->minorversion;
1528 unconf->cl_cb_conn.cb_prog = cr_ses->callback_prog;
1529 unconf->cl_cb_seq_nr = 1;
1530 nfsd4_probe_callback(unconf, &unconf->cl_cb_conn);
1531 }
1532 conf = unconf; 1531 conf = unconf;
1533 } else { 1532 } else {
1534 status = nfserr_stale_clientid; 1533 status = nfserr_stale_clientid;
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h
index 8d5e2370cce0..6e63c1d272bf 100644
--- a/fs/nfsd/state.h
+++ b/fs/nfsd/state.h
@@ -234,6 +234,7 @@ struct nfs4_client {
234 u32 cl_cb_ident; 234 u32 cl_cb_ident;
235 atomic_t cl_cb_set; 235 atomic_t cl_cb_set;
236 struct nfsd4_callback cl_cb_null; 236 struct nfsd4_callback cl_cb_null;
237 struct nfsd4_session *cl_cb_session;
237 238
238 /* for all client information that callback code might need: */ 239 /* for all client information that callback code might need: */
239 spinlock_t cl_lock; 240 spinlock_t cl_lock;