From patchwork Sun Sep 27 16:50:23 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 34349 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.samba.org (fn.samba.org [216.83.154.106]) by ozlabs.org (Postfix) with ESMTP id 6F792B7BCF for ; Mon, 28 Sep 2009 02:57:28 +1000 (EST) Received: from fn.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id 7A32BAD180; Sun, 27 Sep 2009 10:56:59 -0600 (MDT) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on fn.samba.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=3.8 tests=AWL, BAYES_00, NO_MORE_FUNN, SPF_PASS autolearn=no version=3.2.5 X-Original-To: linux-cifs-client@lists.samba.org Delivered-To: linux-cifs-client@lists.samba.org Received: from cdptpa-omtalb.mail.rr.com (cdptpa-omtalb.mail.rr.com [75.180.132.121]) by lists.samba.org (Postfix) with ESMTP id 70681AD150 for ; Sun, 27 Sep 2009 10:56:48 -0600 (MDT) Received: from mail.poochiereds.net ([71.70.153.3]) by cdptpa-omta04.mail.rr.com with ESMTP id <20090927165715690.RTTH19321@cdptpa-omta04.mail.rr.com>; Sun, 27 Sep 2009 16:57:15 +0000 Received: by mail.poochiereds.net (Postfix, from userid 4447) id EEB4058169; Sun, 27 Sep 2009 12:50:30 -0400 (EDT) From: Jeff Layton To: linux-nfs@vger.kernel.org, linux-cifs-client@lists.samba.org Date: Sun, 27 Sep 2009 12:50:23 -0400 Message-Id: <1254070230-13125-3-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.6.0.6 In-Reply-To: <1254070230-13125-1-git-send-email-jlayton@redhat.com> References: <1254070230-13125-1-git-send-email-jlayton@redhat.com> Subject: [linux-cifs-client] [RFC PATCH 2/9] sunrpc: move check for too small reply size into rpc_verify_header X-BeenThere: linux-cifs-client@lists.samba.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: The Linux CIFS VFS client List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-cifs-client-bounces@lists.samba.org Errors-To: linux-cifs-client-bounces@lists.samba.org ...this should introduce no behavioral changes. Signed-off-by: Jeff Layton --- net/sunrpc/clnt.c | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-) diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index f675416..e504b59 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -1411,18 +1411,6 @@ call_decode(struct rpc_task *task) WARN_ON(memcmp(&req->rq_rcv_buf, &req->rq_private_buf, sizeof(req->rq_rcv_buf)) != 0); - if (req->rq_rcv_buf.len < 12) { - if (!RPC_IS_SOFT(task)) { - task->tk_action = call_bind; - clnt->cl_stats->rpcretrans++; - goto out_retry; - } - dprintk("RPC: %s: too small RPC reply size (%d bytes)\n", - clnt->cl_protname, task->tk_status); - task->tk_action = call_timeout; - goto out_retry; - } - p = rpc_verify_header(task); if (IS_ERR(p)) { if (p == ERR_PTR(-EAGAIN)) @@ -1518,6 +1506,18 @@ rpc_verify_header(struct rpc_task *task) u32 n; int error = -EACCES; + if (task->tk_rqstp->rq_rcv_buf.len < 12) { + if (!RPC_IS_SOFT(task)) { + task->tk_action = call_bind; + task->tk_client->cl_stats->rpcretrans++; + goto out_retry; + } + dprintk("RPC: %s: too small RPC reply size (%d bytes)\n", + task->tk_client->cl_protname, task->tk_status); + task->tk_action = call_timeout; + goto out_retry; + } + if ((task->tk_rqstp->rq_rcv_buf.len & 3) != 0) { /* RFC-1014 says that the representation of XDR data must be a * multiple of four bytes