Commit b910544a authored by Chuck Lever's avatar Chuck Lever

NFSD: Document the phases of CREATE_SESSION

As described in RFC 8881 Section 18.36.4, CREATE_SESSION can be
split into four phases. NFSD's implementation now does it like that
description.
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent e4469c6c
...@@ -3762,6 +3762,8 @@ nfsd4_create_session(struct svc_rqst *rqstp, ...@@ -3762,6 +3762,8 @@ nfsd4_create_session(struct svc_rqst *rqstp,
goto out_free_session; goto out_free_session;
spin_lock(&nn->client_lock); spin_lock(&nn->client_lock);
/* RFC 8881 Section 18.36.4 Phase 1: Client record look-up. */
unconf = find_unconfirmed_client(&cr_ses->clientid, true, nn); unconf = find_unconfirmed_client(&cr_ses->clientid, true, nn);
conf = find_confirmed_client(&cr_ses->clientid, true, nn); conf = find_confirmed_client(&cr_ses->clientid, true, nn);
if (!conf && !unconf) { if (!conf && !unconf) {
...@@ -3769,6 +3771,7 @@ nfsd4_create_session(struct svc_rqst *rqstp, ...@@ -3769,6 +3771,7 @@ nfsd4_create_session(struct svc_rqst *rqstp,
goto out_free_conn; goto out_free_conn;
} }
/* RFC 8881 Section 18.36.4 Phase 2: Sequence ID processing. */
if (conf) if (conf)
cs_slot = &conf->cl_cs_slot; cs_slot = &conf->cl_cs_slot;
else else
...@@ -3784,6 +3787,7 @@ nfsd4_create_session(struct svc_rqst *rqstp, ...@@ -3784,6 +3787,7 @@ nfsd4_create_session(struct svc_rqst *rqstp,
cs_slot->sl_seqid++; cs_slot->sl_seqid++;
cr_ses->seqid = cs_slot->sl_seqid; cr_ses->seqid = cs_slot->sl_seqid;
/* RFC 8881 Section 18.36.4 Phase 3: Client ID confirmation. */
if (conf) { if (conf) {
status = nfserr_wrong_cred; status = nfserr_wrong_cred;
if (!nfsd4_mach_creds_match(conf, rqstp)) if (!nfsd4_mach_creds_match(conf, rqstp))
...@@ -3810,6 +3814,8 @@ nfsd4_create_session(struct svc_rqst *rqstp, ...@@ -3810,6 +3814,8 @@ nfsd4_create_session(struct svc_rqst *rqstp,
move_to_confirmed(unconf); move_to_confirmed(unconf);
conf = unconf; conf = unconf;
} }
/* RFC 8881 Section 18.36.4 Phase 4: Session creation. */
status = nfs_ok; status = nfs_ok;
/* Persistent sessions are not supported */ /* Persistent sessions are not supported */
cr_ses->flags &= ~SESSION4_PERSIST; cr_ses->flags &= ~SESSION4_PERSIST;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment