Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0533b130 authored by Chuck Lever's avatar Chuck Lever Committed by Anna Schumaker
Browse files

svc: Avoid garbage replies when pc_func() returns rpc_drop_reply



If an RPC program does not set vs_dispatch and pc_func() returns
rpc_drop_reply, the server sends a reply anyway containing a single
word containing the value RPC_DROP_REPLY (in network byte-order, of
course). This is a nonsense RPC message.

Fixes: 9e701c61 ("svcrpc: simpler request dropping")
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Tested-by: default avatarSteve Wise <swise@opengridcomputing.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 65b80179
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -1188,7 +1188,8 @@ svc_process_common(struct svc_rqst *rqstp, struct kvec *argv, struct kvec *resv)
		*statp = procp->pc_func(rqstp, rqstp->rq_argp, rqstp->rq_resp);
		*statp = procp->pc_func(rqstp, rqstp->rq_argp, rqstp->rq_resp);


		/* Encode reply */
		/* Encode reply */
		if (test_bit(RQ_DROPME, &rqstp->rq_flags)) {
		if (*statp == rpc_drop_reply ||
		    test_bit(RQ_DROPME, &rqstp->rq_flags)) {
			if (procp->pc_release)
			if (procp->pc_release)
				procp->pc_release(rqstp, NULL, rqstp->rq_resp);
				procp->pc_release(rqstp, NULL, rqstp->rq_resp);
			goto dropit;
			goto dropit;