From patchwork Thu May 22 00:56:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever III X-Patchwork-Id: 4219631 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 090A99F1CD for ; Thu, 22 May 2014 00:56:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 34A8920148 for ; Thu, 22 May 2014 00:56:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 652EF200FE for ; Thu, 22 May 2014 00:56:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753029AbaEVA4x (ORCPT ); Wed, 21 May 2014 20:56:53 -0400 Received: from mail-ie0-f177.google.com ([209.85.223.177]:44008 "EHLO mail-ie0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752065AbaEVA4w (ORCPT ); Wed, 21 May 2014 20:56:52 -0400 Received: by mail-ie0-f177.google.com with SMTP id y20so2839455ier.36 for ; Wed, 21 May 2014 17:56:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:subject:to:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=167In3IHI/NRV3cW5PnwnXrlxwOzKaZUyKoE4F5nOaY=; b=VJYHl7J87Bve9IvHHQt8J07i3v63Y9qB79TXlS3mBFdZ391ZNtKPbSEdjlvGzJ31+b IFA4LPjxPhsIhdmYzJzQKt97790bFpL7KZkAWXVzG5bjQcQhPHGLCN7fqWMKlq3RD2t9 Yf5y/jdZf6F4Vqjc5lOaPJ/oykBy/CHK68itSaZclkVrQ3g4LLfxG8LPAy3aXtmYRzL5 TA3r8cIgtj3oFTDVhFdpIvoValN9ofX4NUCoaZGxesJ081SpQhY6eGkGkZ05sabgDPjs QV+FPld+xt2v+JcCLGqJjH56+/k6VnPDyif6Y9WhULT/j8TUBcQRxslvg2ay87LvRgpR 6MyA== X-Received: by 10.50.82.105 with SMTP id h9mr17852287igy.6.1400720211931; Wed, 21 May 2014 17:56:51 -0700 (PDT) Received: from manet.1015granger.net ([2604:8800:100:81fc:82ee:73ff:fe43:d64f]) by mx.google.com with ESMTPSA id h5sm9262505igi.4.2014.05.21.17.56.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 May 2014 17:56:51 -0700 (PDT) From: Chuck Lever Subject: [PATCH v4 18/24] xprtrdma: Allocate missing pagelist To: linux-nfs@vger.kernel.org, linux-rdma@vger.kernel.org Date: Wed, 21 May 2014 20:56:50 -0400 Message-ID: <20140522005650.27190.241.stgit@manet.1015granger.net> In-Reply-To: <20140522004505.27190.58897.stgit@manet.1015granger.net> References: <20140522004505.27190.58897.stgit@manet.1015granger.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Shirley Ma GETACL relies on transport layer to alloc memory for reply buffer. However xprtrdma assumes that the reply buffer (pagelist) has been pre-allocated in upper layer. This problem was reported by IOL OFA lab test on PPC. Signed-off-by: Shirley Ma Reviewed-by: Chuck Lever Tested-by: Edward Mossman --- net/sunrpc/xprtrdma/rpc_rdma.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/sunrpc/xprtrdma/rpc_rdma.c b/net/sunrpc/xprtrdma/rpc_rdma.c index 436d229..dc4a826 100644 --- a/net/sunrpc/xprtrdma/rpc_rdma.c +++ b/net/sunrpc/xprtrdma/rpc_rdma.c @@ -99,6 +99,12 @@ rpcrdma_convert_iovs(struct xdr_buf *xdrbuf, unsigned int pos, page_base = xdrbuf->page_base & ~PAGE_MASK; p = 0; while (len && n < nsegs) { + if (!ppages[p]) { + /* alloc the pagelist for receiving buffer */ + ppages[p] = alloc_page(GFP_ATOMIC); + if (!ppages[p]) + return 0; + } seg[n].mr_page = ppages[p]; seg[n].mr_offset = (void *)(unsigned long) page_base; seg[n].mr_len = min_t(u32, PAGE_SIZE - page_base, len);