From patchwork Wed May 18 21:07:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 9122401 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C115F9F37F for ; Wed, 18 May 2016 21:08:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E8797202EC for ; Wed, 18 May 2016 21:08:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 129E3202AE for ; Wed, 18 May 2016 21:08:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753312AbcERVIK (ORCPT ); Wed, 18 May 2016 17:08:10 -0400 Received: from mail-pf0-f182.google.com ([209.85.192.182]:33349 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752523AbcERVIJ (ORCPT ); Wed, 18 May 2016 17:08:09 -0400 Received: by mail-pf0-f182.google.com with SMTP id 206so22368610pfu.0 for ; Wed, 18 May 2016 14:08:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=primarydata-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7w4vcyt903pz/4pU7X/ctNM4B8kWYlUZWsHIDIBxM4I=; b=bsZWKH19z6MAMcWCgDhrnGbb+QdJR9pCSw78dCWK8uWKet6kJbNiWSC/ByZLlex/V0 r8CbcpbgaRnQrLmMzZJzdzNXXZc4nNGfA+/tfSpkgVd/CQqRZNw9stKG9DTSaSMFfTIX g2Ts+uH0JwSCM/BesYgu/rVHFISx7oqMGl9wtjzs8pbdxSls9rmIr8vnzs+C5t7rwi2q TK462g7misr3rBMw7ZgT4UQssVVgYSqNVnmAsF+CzDcqZwN7QCWn1i9gz7xpb06NiVi1 Rrmpi9yNQZ4C47D1ar0aCM9K1Xm5BNHs9ASy9WqByw7H6myxo+dnD0Ui2QWNLVQExJt9 Ghbw== 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=7w4vcyt903pz/4pU7X/ctNM4B8kWYlUZWsHIDIBxM4I=; b=Go7UQtvTmSvvg0O9XII29N1Xhedud3o6Xp2Y96ldpy24K6COfGr8oMDQKNQkA7Gl/Q 9OY2Cp+3lNsQ5y0hvZTiiF0dzf93vTMS5xpM6WZNcE8QqTyMJLSFcVVSULRI/R1ra9Bf AXM9syP1y68ea0qVlSO9KfwDqZFuj0ewQ+Z1/vZYTdHGn359INXbg8pKRo7iHv5+otW+ wyosvW1A7JGLHsuO/eEr3DyGEG6lqpO3gFl/rfDPKWqP3qjvpxNXGJ2rADJqGaYWf/lD EK1kvSWpZMVBYEZVywGdjXk5SOlaJ8qOtnRa2iuO5KYmpeDvao+rlL64Qq1/qTUUK+3t q/7Q== X-Gm-Message-State: AOPr4FUUpAdXaCYfg1LkPzWE6mpCLUxmWow9Kml+ocGQdfP0qC8plUG5SwVUh4pIvVvxTLkJ X-Received: by 10.98.72.199 with SMTP id q68mr14071010pfi.164.1463605688667; Wed, 18 May 2016 14:08:08 -0700 (PDT) Received: from jhereg.localdomain (63-157-6-18.dia.static.qwest.net. [63.157.6.18]) by smtp.gmail.com with ESMTPSA id lg17sm5134544pab.36.2016.05.18.14.08.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 May 2016 14:08:08 -0700 (PDT) From: Tom Haynes X-Google-Original-From: Tom Haynes To: Trond Myklebust Cc: Linux NFS Mailing list , Anna Schumaker Subject: [PATCH 2/3] nfs/flexfiles: Use the layout segment for reading unless it a IOMODE_RW and reading is disabled Date: Wed, 18 May 2016 14:07:55 -0700 Message-Id: <1463605676-82483-3-git-send-email-loghyr@primarydata.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1463605676-82483-1-git-send-email-loghyr@primarydata.com> References: <1463605676-82483-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=-8.2 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 Signed-off-by: Tom Haynes --- fs/nfs/flexfilelayout/flexfilelayout.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index 981b39a..ea24b0a 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.c +++ b/fs/nfs/flexfilelayout/flexfilelayout.c @@ -852,7 +852,8 @@ ff_layout_pg_init_read(struct nfs_pageio_descriptor *pgio, int ds_idx; /* Use full layout for now */ - if (!pgio->pg_lseg) { + if (!pgio->pg_lseg || ff_layout_avoid_read_on_rw(pgio->pg_lseg)) { + pnfs_put_lseg(pgio->pg_lseg); pgio->pg_lseg = pnfs_update_layout(pgio->pg_inode, req->wb_context, 0, @@ -862,9 +863,9 @@ ff_layout_pg_init_read(struct nfs_pageio_descriptor *pgio, if (IS_ERR(pgio->pg_lseg)) { pgio->pg_error = PTR_ERR(pgio->pg_lseg); pgio->pg_lseg = NULL; - return; } } + /* If no lseg, fall back to read through mds */ if (pgio->pg_lseg == NULL) goto out_mds;