Skip to content

Commit b910544

Browse files
committed
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: Chuck Lever <[email protected]>
1 parent e4469c6 commit b910544

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

fs/nfsd/nfs4state.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3762,13 +3762,16 @@ nfsd4_create_session(struct svc_rqst *rqstp,
37623762
goto out_free_session;
37633763

37643764
spin_lock(&nn->client_lock);
3765+
3766+
/* RFC 8881 Section 18.36.4 Phase 1: Client record look-up. */
37653767
unconf = find_unconfirmed_client(&cr_ses->clientid, true, nn);
37663768
conf = find_confirmed_client(&cr_ses->clientid, true, nn);
37673769
if (!conf && !unconf) {
37683770
status = nfserr_stale_clientid;
37693771
goto out_free_conn;
37703772
}
37713773

3774+
/* RFC 8881 Section 18.36.4 Phase 2: Sequence ID processing. */
37723775
if (conf)
37733776
cs_slot = &conf->cl_cs_slot;
37743777
else
@@ -3784,6 +3787,7 @@ nfsd4_create_session(struct svc_rqst *rqstp,
37843787
cs_slot->sl_seqid++;
37853788
cr_ses->seqid = cs_slot->sl_seqid;
37863789

3790+
/* RFC 8881 Section 18.36.4 Phase 3: Client ID confirmation. */
37873791
if (conf) {
37883792
status = nfserr_wrong_cred;
37893793
if (!nfsd4_mach_creds_match(conf, rqstp))
@@ -3810,6 +3814,8 @@ nfsd4_create_session(struct svc_rqst *rqstp,
38103814
move_to_confirmed(unconf);
38113815
conf = unconf;
38123816
}
3817+
3818+
/* RFC 8881 Section 18.36.4 Phase 4: Session creation. */
38133819
status = nfs_ok;
38143820
/* Persistent sessions are not supported */
38153821
cr_ses->flags &= ~SESSION4_PERSIST;

0 commit comments

Comments
 (0)