aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfs/callback_xdr.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c
index 13619d24f023..646d4d85072e 100644
--- a/fs/nfs/callback_xdr.c
+++ b/fs/nfs/callback_xdr.c
@@ -401,12 +401,12 @@ static __be32 process_op(struct svc_rqst *rqstp,
401 */ 401 */
402static __be32 nfs4_callback_compound(struct svc_rqst *rqstp, void *argp, void *resp) 402static __be32 nfs4_callback_compound(struct svc_rqst *rqstp, void *argp, void *resp)
403{ 403{
404 struct cb_compound_hdr_arg hdr_arg; 404 struct cb_compound_hdr_arg hdr_arg = { 0 };
405 struct cb_compound_hdr_res hdr_res; 405 struct cb_compound_hdr_res hdr_res = { NULL };
406 struct xdr_stream xdr_in, xdr_out; 406 struct xdr_stream xdr_in, xdr_out;
407 __be32 *p; 407 __be32 *p;
408 __be32 status; 408 __be32 status;
409 unsigned int nops = 1; 409 unsigned int nops = 0;
410 410
411 dprintk("%s: start\n", __FUNCTION__); 411 dprintk("%s: start\n", __FUNCTION__);
412 412
@@ -415,20 +415,20 @@ static __be32 nfs4_callback_compound(struct svc_rqst *rqstp, void *argp, void *r
415 p = (__be32*)((char *)rqstp->rq_res.head[0].iov_base + rqstp->rq_res.head[0].iov_len); 415 p = (__be32*)((char *)rqstp->rq_res.head[0].iov_base + rqstp->rq_res.head[0].iov_len);
416 xdr_init_encode(&xdr_out, &rqstp->rq_res, p); 416 xdr_init_encode(&xdr_out, &rqstp->rq_res, p);
417 417
418 decode_compound_hdr_arg(&xdr_in, &hdr_arg); 418 status = decode_compound_hdr_arg(&xdr_in, &hdr_arg);
419 if (status == __constant_htonl(NFS4ERR_RESOURCE))
420 return rpc_garbage_args;
421
419 hdr_res.taglen = hdr_arg.taglen; 422 hdr_res.taglen = hdr_arg.taglen;
420 hdr_res.tag = hdr_arg.tag; 423 hdr_res.tag = hdr_arg.tag;
421 hdr_res.nops = NULL; 424 if (encode_compound_hdr_res(&xdr_out, &hdr_res) != 0)
422 encode_compound_hdr_res(&xdr_out, &hdr_res); 425 return rpc_system_err;
423 426
424 for (;;) { 427 while (status == 0 && nops != hdr_arg.nops) {
425 status = process_op(rqstp, &xdr_in, argp, &xdr_out, resp); 428 status = process_op(rqstp, &xdr_in, argp, &xdr_out, resp);
426 if (status != 0)
427 break;
428 if (nops == hdr_arg.nops)
429 break;
430 nops++; 429 nops++;
431 } 430 }
431
432 *hdr_res.status = status; 432 *hdr_res.status = status;
433 *hdr_res.nops = htonl(nops); 433 *hdr_res.nops = htonl(nops);
434 dprintk("%s: done, status = %u\n", __FUNCTION__, ntohl(status)); 434 dprintk("%s: done, status = %u\n", __FUNCTION__, ntohl(status));