diff options
author | Andy Adamson <andros@netapp.com> | 2013-09-10 12:56:29 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-09-10 13:04:37 -0400 |
commit | 9f79fb4825cd336ba9efbb0d9468f2ef3fd3cbf6 (patch) | |
tree | 8509a2e131253ace082a5710f15acc84ba3802d5 /fs/nfs/nfs4xdr.c | |
parent | b1b3e136948a2bf4915326acb0d825d7d180753f (diff) |
NFSv4.1 fix decode_free_stateid
The operation status is decoded in decode_op_hdr.
Stop the print_overflow message that is always hit without this patch:
nfs: decode_free_stateid: prematurely hit end of receive buffer. Remaining
buffer length is 0 words.
Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r-- | fs/nfs/nfs4xdr.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index fbdad9e1719f..79210d23f607 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -414,7 +414,7 @@ static int nfs4_stat_to_errno(int); | |||
414 | #define decode_test_stateid_maxsz (op_decode_hdr_maxsz + 2 + 1) | 414 | #define decode_test_stateid_maxsz (op_decode_hdr_maxsz + 2 + 1) |
415 | #define encode_free_stateid_maxsz (op_encode_hdr_maxsz + 1 + \ | 415 | #define encode_free_stateid_maxsz (op_encode_hdr_maxsz + 1 + \ |
416 | XDR_QUADLEN(NFS4_STATEID_SIZE)) | 416 | XDR_QUADLEN(NFS4_STATEID_SIZE)) |
417 | #define decode_free_stateid_maxsz (op_decode_hdr_maxsz + 1) | 417 | #define decode_free_stateid_maxsz (op_decode_hdr_maxsz) |
418 | #else /* CONFIG_NFS_V4_1 */ | 418 | #else /* CONFIG_NFS_V4_1 */ |
419 | #define encode_sequence_maxsz 0 | 419 | #define encode_sequence_maxsz 0 |
420 | #define decode_sequence_maxsz 0 | 420 | #define decode_sequence_maxsz 0 |
@@ -5966,21 +5966,8 @@ out: | |||
5966 | static int decode_free_stateid(struct xdr_stream *xdr, | 5966 | static int decode_free_stateid(struct xdr_stream *xdr, |
5967 | struct nfs41_free_stateid_res *res) | 5967 | struct nfs41_free_stateid_res *res) |
5968 | { | 5968 | { |
5969 | __be32 *p; | 5969 | res->status = decode_op_hdr(xdr, OP_FREE_STATEID); |
5970 | int status; | ||
5971 | |||
5972 | status = decode_op_hdr(xdr, OP_FREE_STATEID); | ||
5973 | if (status) | ||
5974 | return status; | ||
5975 | |||
5976 | p = xdr_inline_decode(xdr, 4); | ||
5977 | if (unlikely(!p)) | ||
5978 | goto out_overflow; | ||
5979 | res->status = be32_to_cpup(p++); | ||
5980 | return res->status; | 5970 | return res->status; |
5981 | out_overflow: | ||
5982 | print_overflow_msg(__func__, xdr); | ||
5983 | return -EIO; | ||
5984 | } | 5971 | } |
5985 | #endif /* CONFIG_NFS_V4_1 */ | 5972 | #endif /* CONFIG_NFS_V4_1 */ |
5986 | 5973 | ||