提交 136e658d 编写于 作者: J J. Bruce Fields

nfsd4: rearrange exchange_id logic to simplify

Minor cleanup: it's simpler to have separate code paths for the update
and non-update cases.
Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
上级 2dbb269d
...@@ -1557,37 +1557,37 @@ nfsd4_exchange_id(struct svc_rqst *rqstp, ...@@ -1557,37 +1557,37 @@ nfsd4_exchange_id(struct svc_rqst *rqstp,
bool creds_match = same_creds(&conf->cl_cred, &rqstp->rq_cred); bool creds_match = same_creds(&conf->cl_cred, &rqstp->rq_cred);
bool verfs_match = same_verf(&verf, &conf->cl_verifier); bool verfs_match = same_verf(&verf, &conf->cl_verifier);
if (!clp_used_exchangeid(conf)) { if (update) {
if (update) { /* buggy client */ if (!clp_used_exchangeid(conf)) { /* buggy client */
status = nfserr_inval; status = nfserr_inval;
goto out; goto out;
} }
}
if (!creds_match) { /* case 9 */ if (!creds_match) { /* case 9 */
if (update)
status = nfserr_perm; status = nfserr_perm;
else /* case 3 */
status = nfserr_clid_inuse;
goto out; goto out;
} }
if (!verfs_match) { /* case 8 */ if (!verfs_match) { /* case 8 */
if (update) {
status = nfserr_not_same; status = nfserr_not_same;
goto out; goto out;
} }
/* case 5, client reboot */ /* case 6 */
expire_client(conf); exid->flags |= EXCHGID4_FLAG_CONFIRMED_R;
goto out_new; new = conf;
goto out_copy;
} }
if (!clp_used_exchangeid(conf)) { if (!creds_match) { /* case 3 */
status = nfserr_inval; status = nfserr_clid_inuse;
goto out; goto out;
} }
/* case 2 */ if (verfs_match) { /* case 2 */
exid->flags |= EXCHGID4_FLAG_CONFIRMED_R; exid->flags |= EXCHGID4_FLAG_CONFIRMED_R;
new = conf; new = conf;
goto out_copy; goto out_copy;
} }
/* case 5, client reboot */
expire_client(conf);
goto out_new;
}
if (update) { /* case 7 */ if (update) { /* case 7 */
status = nfserr_noent; status = nfserr_noent;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册