提交 82743380 编写于 作者: K Kinglong Mee 提交者: J. Bruce Fields

nfsd/callback: Drop a useless data copy when comparing sessionid

Signed-off-by: NKinglong Mee <kinglongmee@gmail.com>
Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
上级 e86a40bc
...@@ -397,13 +397,10 @@ static int decode_cb_sequence4resok(struct xdr_stream *xdr, ...@@ -397,13 +397,10 @@ static int decode_cb_sequence4resok(struct xdr_stream *xdr,
struct nfsd4_callback *cb) struct nfsd4_callback *cb)
{ {
struct nfsd4_session *session = cb->cb_clp->cl_cb_session; struct nfsd4_session *session = cb->cb_clp->cl_cb_session;
struct nfs4_sessionid id; int status = -ESERVERFAULT;
int status;
__be32 *p; __be32 *p;
u32 dummy; u32 dummy;
status = -ESERVERFAULT;
/* /*
* If the server returns different values for sessionID, slotID or * If the server returns different values for sessionID, slotID or
* sequence number, the server is looney tunes. * sequence number, the server is looney tunes.
...@@ -411,9 +408,8 @@ static int decode_cb_sequence4resok(struct xdr_stream *xdr, ...@@ -411,9 +408,8 @@ static int decode_cb_sequence4resok(struct xdr_stream *xdr,
p = xdr_inline_decode(xdr, NFS4_MAX_SESSIONID_LEN + 4 + 4 + 4 + 4); p = xdr_inline_decode(xdr, NFS4_MAX_SESSIONID_LEN + 4 + 4 + 4 + 4);
if (unlikely(p == NULL)) if (unlikely(p == NULL))
goto out_overflow; goto out_overflow;
memcpy(id.data, p, NFS4_MAX_SESSIONID_LEN);
if (memcmp(id.data, session->se_sessionid.data, if (memcmp(p, session->se_sessionid.data, NFS4_MAX_SESSIONID_LEN)) {
NFS4_MAX_SESSIONID_LEN) != 0) {
dprintk("NFS: %s Invalid session id\n", __func__); dprintk("NFS: %s Invalid session id\n", __func__);
goto out; goto out;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册