Commit 2dbb269d authored by J. Bruce Fields's avatar J. Bruce Fields

nfsd4: exchange_id cleanup: comments

Make these comments a bit more concise and uniform.
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 83e08fd4
...@@ -1550,6 +1550,7 @@ nfsd4_exchange_id(struct svc_rqst *rqstp, ...@@ -1550,6 +1550,7 @@ nfsd4_exchange_id(struct svc_rqst *rqstp,
strhashval = clientstr_hashval(dname); strhashval = clientstr_hashval(dname);
/* Cases below refer to rfc 5661 section 18.35.4: */
nfs4_lock_state(); nfs4_lock_state();
conf = find_confirmed_client_by_str(dname, strhashval); conf = find_confirmed_client_by_str(dname, strhashval);
if (conf) { if (conf) {
...@@ -1557,26 +1558,24 @@ nfsd4_exchange_id(struct svc_rqst *rqstp, ...@@ -1557,26 +1558,24 @@ nfsd4_exchange_id(struct svc_rqst *rqstp,
bool verfs_match = same_verf(&verf, &conf->cl_verifier); bool verfs_match = same_verf(&verf, &conf->cl_verifier);
if (!clp_used_exchangeid(conf)) { if (!clp_used_exchangeid(conf)) {
if (update) { if (update) { /* buggy client */
status = nfserr_inval; /* buggy client */ status = nfserr_inval;
goto out; goto out;
} }
} }
if (!creds_match) { if (!creds_match) { /* case 9 */
/* 18.35.4 case 9 */
if (update) if (update)
status = nfserr_perm; status = nfserr_perm;
else /* case 3 */ else /* case 3 */
status = nfserr_clid_inuse; status = nfserr_clid_inuse;
goto out; goto out;
} }
if (!verfs_match) { if (!verfs_match) { /* case 8 */
/* 18.35.4 case 8 */
if (update) { if (update) {
status = nfserr_not_same; status = nfserr_not_same;
goto out; goto out;
} }
/* Client reboot: destroy old state */ /* case 5, client reboot */
expire_client(conf); expire_client(conf);
goto out_new; goto out_new;
} }
...@@ -1584,38 +1583,23 @@ nfsd4_exchange_id(struct svc_rqst *rqstp, ...@@ -1584,38 +1583,23 @@ nfsd4_exchange_id(struct svc_rqst *rqstp,
status = nfserr_inval; status = nfserr_inval;
goto out; goto out;
} }
/* /* case 2 */
* Set bit when the owner id and verifier map to an already
* confirmed client id (18.35.3).
*/
exid->flags |= EXCHGID4_FLAG_CONFIRMED_R; exid->flags |= EXCHGID4_FLAG_CONFIRMED_R;
/*
* Falling into 18.35.4 case 2, possible router replay.
* Leave confirmed record intact and return same result.
*/
new = conf; new = conf;
goto out_copy; goto out_copy;
} }
/* 18.35.4 case 7 */ if (update) { /* case 7 */
if (update) {
status = nfserr_noent; status = nfserr_noent;
goto out; goto out;
} }
unconf = find_unconfirmed_client_by_str(dname, strhashval); unconf = find_unconfirmed_client_by_str(dname, strhashval);
if (unconf) { if (unconf) /* case 4, possible retry or client restart */
/*
* Possible retry or client restart. Per 18.35.4 case 4,
* a new unconfirmed record should be generated regardless
* of whether any properties have changed.
*/
expire_client(unconf); expire_client(unconf);
}
/* case 1 (normal case) */
out_new: out_new:
/* Normal case */
new = create_client(exid->clname, dname, rqstp, &verf); new = create_client(exid->clname, dname, rqstp, &verf);
if (new == NULL) { if (new == NULL) {
status = nfserr_jukebox; status = nfserr_jukebox;
......
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