Pārlūkot izejas kodu

nfs41: directly encode back channel error

Skip all other processing when error is encountered.

Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Andy Adamson 15 gadi atpakaļ
vecāks
revīzija
b92b301900
1 mainītis faili ar 4 papildinājumiem un 1 dzēšanām
  1. 4 1
      fs/nfs/callback_xdr.c

+ 4 - 1
fs/nfs/callback_xdr.c

@@ -625,16 +625,19 @@ static __be32 process_op(uint32_t minorversion, int nop,
 				preprocess_nfs4_op(op_nr, &op);
 				preprocess_nfs4_op(op_nr, &op);
 	if (status == htonl(NFS4ERR_OP_ILLEGAL))
 	if (status == htonl(NFS4ERR_OP_ILLEGAL))
 		op_nr = OP_CB_ILLEGAL;
 		op_nr = OP_CB_ILLEGAL;
+	if (status)
+		goto encode_hdr;
 
 
 	maxlen = xdr_out->end - xdr_out->p;
 	maxlen = xdr_out->end - xdr_out->p;
 	if (maxlen > 0 && maxlen < PAGE_SIZE) {
 	if (maxlen > 0 && maxlen < PAGE_SIZE) {
-		if (likely(status == 0 && op->decode_args != NULL))
+		if (likely(op->decode_args != NULL))
 			status = op->decode_args(rqstp, xdr_in, argp);
 			status = op->decode_args(rqstp, xdr_in, argp);
 		if (likely(status == 0 && op->process_op != NULL))
 		if (likely(status == 0 && op->process_op != NULL))
 			status = op->process_op(argp, resp);
 			status = op->process_op(argp, resp);
 	} else
 	} else
 		status = htonl(NFS4ERR_RESOURCE);
 		status = htonl(NFS4ERR_RESOURCE);
 
 
+encode_hdr:
 	res = encode_op_hdr(xdr_out, op_nr, status);
 	res = encode_op_hdr(xdr_out, op_nr, status);
 	if (unlikely(res))
 	if (unlikely(res))
 		return res;
 		return res;