From patchwork Mon Mar 17 17:10:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 3845191 Return-Path: X-Original-To: patchwork-linux-nfs@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 906AC9F369 for ; Mon, 17 Mar 2014 17:10:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C2F3E201F7 for ; Mon, 17 Mar 2014 17:10:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 14C9920170 for ; Mon, 17 Mar 2014 17:10:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751639AbaCQRKQ (ORCPT ); Mon, 17 Mar 2014 13:10:16 -0400 Received: from mail-qa0-f48.google.com ([209.85.216.48]:53487 "EHLO mail-qa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751097AbaCQRKP (ORCPT ); Mon, 17 Mar 2014 13:10:15 -0400 Received: by mail-qa0-f48.google.com with SMTP id m5so5563817qaj.21 for ; Mon, 17 Mar 2014 10:10:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=J+zUVoH8tnjmoI3w9EL6QuFJizKg281vfzMeHtWqB1o=; b=JlW6lezoCyEu58OLt7aXJ8eexx10Si6ud1BX6tBJZ+wof1KMoyyWSbZWcd+xh2y/6j oUke3nuAttpDodBAh8GWvKkT7fgRJIOCiTHbkqals/pj28RSobX8uxyU6+x/Nj3cyMC7 2o77oOp6NZ5f9FsdQBnKv4HP4YEzrsN4IaoXZg3VIqHlOD6RSzmSS/XnUDwoR8S5neUc jY2fORJjlJU5hhF//76Q71FREvH7OvzcPdWWrguC4Do6fZR65z7c86Y/dTttlx7Q+hwa LT0n6ZY4msHuDAEfKtbw1z10ry8q6F9vo/eUo0QqE07VuU9O9FlqJmbgLn6RGTM//AJt mZBw== X-Gm-Message-State: ALoCoQkb/FcB8MKEequjPTwyciAIqKrRbx9BeB01D9E0WD68fQwC5+jNZeDt9QOgoILB1QPFW2qz X-Received: by 10.224.114.10 with SMTP id c10mr30104594qaq.19.1395076214116; Mon, 17 Mar 2014 10:10:14 -0700 (PDT) Received: from tlielax.poochiereds.net ([2001:470:8:d63:3a60:77ff:fe93:a95d]) by mx.google.com with ESMTPSA id t104sm3316555qga.8.2014.03.17.10.10.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Mar 2014 10:10:13 -0700 (PDT) From: Jeff Layton To: bfields@fieldses.org Cc: tom@opengridcomputing.com, linux-nfs@vger.kernel.org Subject: [PATCH v2] svcrdma: fix offset calculation for non-page aligned sge entries Date: Mon, 17 Mar 2014 13:10:05 -0400 Message-Id: <1395076205-26658-1-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.8.5.3 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 The xdr_off value in dma_map_xdr gets passed to ib_dma_map_page as the offset into the page to be mapped. This calculation does not correctly take into account the case where the data starts at some offset into the page. Increment the xdr_off by the page_base to ensure that it is respected. Cc: Tom Tucker Signed-off-by: Jeff Layton --- net/sunrpc/xprtrdma/svc_rdma_sendto.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c index c1d124dc772b..5f14609b6336 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c +++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c @@ -265,6 +265,7 @@ static dma_addr_t dma_map_xdr(struct svcxprt_rdma *xprt, xdr_off -= xdr->head[0].iov_len; if (xdr_off < xdr->page_len) { /* This offset is in the page list */ + xdr_off += xdr->page_base; page = xdr->pages[xdr_off >> PAGE_SHIFT]; xdr_off &= ~PAGE_MASK; } else {