aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorBryan Schumaker <bjschuma@netapp.com>2012-04-27 13:27:38 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-04-27 14:10:01 -0400
commit31e4dda4747713de13889f7c79c7aec341fea61b (patch)
tree9ec536cc095e2e512d1863301dcf37ca92dde8b5 /fs
parentea8cfa06795bb30d2ea61f503ef129284492c06a (diff)
NFS: Fix SECINFO_NO_NAME
I was using the same decoder function for SECINFO and SECINFO_NO_NAME, so it was returning an error when it tried to decode an OP_SECINFO_NO_NAME header as OP_SECINFO. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/nfs4xdr.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 203c0967451b..c77e802db736 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -5094,16 +5094,13 @@ out_err:
5094 return -EINVAL; 5094 return -EINVAL;
5095} 5095}
5096 5096
5097static int decode_secinfo(struct xdr_stream *xdr, struct nfs4_secinfo_res *res) 5097static int decode_secinfo_common(struct xdr_stream *xdr, struct nfs4_secinfo_res *res)
5098{ 5098{
5099 struct nfs4_secinfo_flavor *sec_flavor; 5099 struct nfs4_secinfo_flavor *sec_flavor;
5100 int status; 5100 int status;
5101 __be32 *p; 5101 __be32 *p;
5102 int i, num_flavors; 5102 int i, num_flavors;
5103 5103
5104 status = decode_op_hdr(xdr, OP_SECINFO);
5105 if (status)
5106 goto out;
5107 p = xdr_inline_decode(xdr, 4); 5104 p = xdr_inline_decode(xdr, 4);
5108 if (unlikely(!p)) 5105 if (unlikely(!p))
5109 goto out_overflow; 5106 goto out_overflow;
@@ -5129,6 +5126,7 @@ static int decode_secinfo(struct xdr_stream *xdr, struct nfs4_secinfo_res *res)
5129 res->flavors->num_flavors++; 5126 res->flavors->num_flavors++;
5130 } 5127 }
5131 5128
5129 status = 0;
5132out: 5130out:
5133 return status; 5131 return status;
5134out_overflow: 5132out_overflow:
@@ -5136,7 +5134,23 @@ out_overflow:
5136 return -EIO; 5134 return -EIO;
5137} 5135}
5138 5136
5137static int decode_secinfo(struct xdr_stream *xdr, struct nfs4_secinfo_res *res)
5138{
5139 int status = decode_op_hdr(xdr, OP_SECINFO);
5140 if (status)
5141 return status;
5142 return decode_secinfo_common(xdr, res);
5143}
5144
5139#if defined(CONFIG_NFS_V4_1) 5145#if defined(CONFIG_NFS_V4_1)
5146static int decode_secinfo_no_name(struct xdr_stream *xdr, struct nfs4_secinfo_res *res)
5147{
5148 int status = decode_op_hdr(xdr, OP_SECINFO_NO_NAME);
5149 if (status)
5150 return status;
5151 return decode_secinfo_common(xdr, res);
5152}
5153
5140static int decode_exchange_id(struct xdr_stream *xdr, 5154static int decode_exchange_id(struct xdr_stream *xdr,
5141 struct nfs41_exchange_id_res *res) 5155 struct nfs41_exchange_id_res *res)
5142{ 5156{
@@ -6821,7 +6835,7 @@ static int nfs4_xdr_dec_secinfo_no_name(struct rpc_rqst *rqstp,
6821 status = decode_putrootfh(xdr); 6835 status = decode_putrootfh(xdr);
6822 if (status) 6836 if (status)
6823 goto out; 6837 goto out;
6824 status = decode_secinfo(xdr, res); 6838 status = decode_secinfo_no_name(xdr, res);
6825out: 6839out:
6826 return status; 6840 return status;
6827} 6841}