summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorKinglong Mee <kinglongmee@gmail.com>2017-02-05 09:57:48 +0800
committerJ. Bruce Fields <bfields@redhat.com>2017-02-17 16:26:02 -0500
commit827433801c3bcf21296915c42c1314fbb944b197 (patch)
tree92398c55a1947fbfc5292c3d4db4d795171a0121 /fs
parente86a40bc7331b7b93a88edd74e6b2f738107a6f9 (diff)
downloadlinux-827433801c3bcf21296915c42c1314fbb944b197.tar.gz
linux-827433801c3bcf21296915c42c1314fbb944b197.tar.xz
nfsd/callback: Drop a useless data copy when comparing sessionid
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/nfs4callback.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index ea74149841e7..0274db6e65d0 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -397,13 +397,10 @@ static int decode_cb_sequence4resok(struct xdr_stream *xdr,
struct nfsd4_callback *cb)
{
struct nfsd4_session *session = cb->cb_clp->cl_cb_session;
- struct nfs4_sessionid id;
- int status;
+ int status = -ESERVERFAULT;
__be32 *p;
u32 dummy;
- status = -ESERVERFAULT;
-
/*
* If the server returns different values for sessionID, slotID or
* sequence number, the server is looney tunes.
@@ -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);
if (unlikely(p == NULL))
goto out_overflow;
- memcpy(id.data, p, NFS4_MAX_SESSIONID_LEN);
- if (memcmp(id.data, session->se_sessionid.data,
- NFS4_MAX_SESSIONID_LEN) != 0) {
+
+ if (memcmp(p, session->se_sessionid.data, NFS4_MAX_SESSIONID_LEN)) {
dprintk("NFS: %s Invalid session id\n", __func__);
goto out;
}