From patchwork Mon Feb 2 22:39:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 5765231 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CA827BF6C3 for ; Mon, 2 Feb 2015 22:41:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0B318209EC for ; Mon, 2 Feb 2015 22:41:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 302BA209EE for ; Mon, 2 Feb 2015 22:41:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965375AbbBBWlo (ORCPT ); Mon, 2 Feb 2015 17:41:44 -0500 Received: from mail-pa0-f42.google.com ([209.85.220.42]:48892 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965279AbbBBWln (ORCPT ); Mon, 2 Feb 2015 17:41:43 -0500 Received: by mail-pa0-f42.google.com with SMTP id bj1so88041980pad.1 for ; Mon, 02 Feb 2015 14:41:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QbiLBguh6FpGW+H+PNlzOi+5yo1K6k0Dkh3pmrPYFGE=; b=G8AA5NodmainTdX4oyGDRAH8xpK1T5MhcVm8CSBV9+CKw3dPSDjlHcqcuMPW0IgXxa vBgNS97L+9fyoJTZDLapZjxFuWTLtGxHqDHuZN3rgykEkCc95cARelqHrGFZls2P9x73 kqK63HjvC0Te/4peeM1iHIBe/DUqmFSjwpS9JBwKSLJpsagC541lKXWD60oFwVkE0ARZ c57RynqossdtCFRMOTtpLwQIxqDQLqnEqikByuPb6kf9P3kIqezOFYwhVib9emFABLke zjtcy+V05jQDZbLeycYq6vsl90JVGGpvSvFRJ8YDu7j2PegQpNz1OWuW+FlndnZkVkqQ icVQ== X-Gm-Message-State: ALoCoQk6x1ucdvv8sklVQf+v/rnYFeS2TuNdhCshKDBv/WiMM7UYke2Efi+wYqATVD/GVZ/Tqcry X-Received: by 10.68.65.35 with SMTP id u3mr32578463pbs.139.1422916903174; Mon, 02 Feb 2015 14:41:43 -0800 (PST) Received: from localhost.localdomain ([50.242.95.105]) by mx.google.com with ESMTPSA id bx13sm94656pdb.19.2015.02.02.14.41.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Feb 2015 14:41:42 -0800 (PST) From: Tom Haynes X-Google-Original-From: Tom Haynes To: Trond Myklebust Cc: Linux NFS Mailing list Subject: [PATCH v6 53/53] pnfs: lookup new lseg at lseg boundary Date: Mon, 2 Feb 2015 14:39:07 -0800 Message-Id: <1422916747-86649-54-git-send-email-loghyr@primarydata.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1422916747-86649-1-git-send-email-loghyr@primarydata.com> References: <1422916747-86649-1-git-send-email-loghyr@primarydata.com> 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 From: Weston Andros Adamson Before mirroring support was added, the pageio descriptor's pg_lseg was set to null when an RPC was sent. Because of this, pg_init was called at lseg boundaries with pg_lseg = NULL, and it could be set to the new lseg. Signed-off-by: Weston Andros Adamson --- fs/nfs/pnfs.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index c7be9b9..9304984 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -1788,10 +1788,16 @@ pnfs_generic_pg_test(struct nfs_pageio_descriptor *pgio, seg_end = end_offset(pgio->pg_lseg->pls_range.offset, pgio->pg_lseg->pls_range.length); req_start = req_offset(req); - WARN_ON_ONCE(req_start > seg_end); + WARN_ON_ONCE(req_start >= seg_end); /* start of request is past the last byte of this segment */ - if (req_start >= seg_end) + if (req_start >= seg_end) { + /* reference the new lseg */ + if (pgio->pg_ops->pg_cleanup) + pgio->pg_ops->pg_cleanup(pgio); + if (pgio->pg_ops->pg_init) + pgio->pg_ops->pg_init(pgio, req); return 0; + } /* adjust 'size' iff there are fewer bytes left in the * segment than what nfs_generic_pg_test returned */