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

nfsd4: kill unnecessary same_name() in setclientid_confirm

If conf and unconf are both found in the lookup by cl_clientid, then
they share the same cl_clientid.  We always create a unique new
cl_clientid field when creating a new client--the only exception is the
"probable callback update" case in setclientid, where we copy the old
cl_clientid from another clientid with the same name.

Therefore two clients with the same cl_client field also always share
the same cl_name field, and a couple of the checks here are redundant.

Thanks to Simon Holm Thøgersen for a compile fix.
Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
Cc: Simon Holm Thøgersen <odie@cs.aau.dk>
上级 deda2faa
...@@ -838,7 +838,6 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, ...@@ -838,7 +838,6 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
if ((conf && unconf) && if ((conf && unconf) &&
(same_verf(&unconf->cl_confirm, &confirm)) && (same_verf(&unconf->cl_confirm, &confirm)) &&
(same_verf(&conf->cl_verifier, &unconf->cl_verifier)) && (same_verf(&conf->cl_verifier, &unconf->cl_verifier)) &&
(same_name(conf->cl_recdir,unconf->cl_recdir)) &&
(!same_verf(&conf->cl_confirm, &unconf->cl_confirm))) { (!same_verf(&conf->cl_confirm, &unconf->cl_confirm))) {
/* /*
* RFC 3530 14.2.34 CASE 1: * RFC 3530 14.2.34 CASE 1:
...@@ -858,8 +857,7 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, ...@@ -858,8 +857,7 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
} }
} else if ((conf && !unconf) || } else if ((conf && !unconf) ||
((conf && unconf) && ((conf && unconf) &&
(!same_verf(&conf->cl_verifier, &unconf->cl_verifier) || !same_verf(&conf->cl_verifier, &unconf->cl_verifier))) {
!same_name(conf->cl_recdir, unconf->cl_recdir)))) {
/* /*
* RFC 3530 14.2.34 CASE 2: * RFC 3530 14.2.34 CASE 2:
* probable retransmitted request; play it safe and * probable retransmitted request; play it safe and
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册