From patchwork Sun May 15 01:06:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 9095731 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 27F8ABF29F for ; Sun, 15 May 2016 01:07:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 036F820263 for ; Sun, 15 May 2016 01:07:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F0EAE2025A for ; Sun, 15 May 2016 01:07:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754004AbcEOBG4 (ORCPT ); Sat, 14 May 2016 21:06:56 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:36664 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753995AbcEOBGz (ORCPT ); Sat, 14 May 2016 21:06:55 -0400 Received: by mail-qk0-f193.google.com with SMTP id l68so11320449qkf.3 for ; Sat, 14 May 2016 18:06:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poochiereds-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=j7G9n3jVVnUvRGwBPou8pb86Xr6APLwjRtg6rKbSqHg=; b=JlYJKi0wpfEkA5Xu8nUlhqPApFXWLphG7osJwBcrmCQo9HbIPurmh2BPXxwSLCNiqq VGi79C7hOjElRNJzbyyYYmZ16lixqbxwxTBeSZDkPsrhP5HbILEBcNMyUr0RHzJ+PDLF G29Cr4M3E2g8uzt25f8bZ6t4QFiV3+lqzADsLaMCX/vDTd+MaK9rogO7nEMm4QZAAefU nd7brxbb0CZbIHClrg7tfdB8cfaKsw9hNzbsoJ+ZjhAt8LT21gwTjh08pZwxe3BxI8IJ D9LpPGBgS4lNiuDWQKtGNvHIN09q3pJ7093TCnjCOknaz1rMo5MyQUtiPGWZAr0gDR2W c/fQ== 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=j7G9n3jVVnUvRGwBPou8pb86Xr6APLwjRtg6rKbSqHg=; b=bCRglgTT3gn+iQwK8rP3K39IV2ONxFFhWX0i3REa6rjiQYNQnxZ6yfyUC4sTezeo8o rQOhgY6RJEANhsHKIZ7RbxJzNqH1iiYcO1ASZf/vMaisW0+RVe1CO9OyIE0D8HD8w3FA C1ufIdwjIbbOTiFnHFg4bnoDp9ImnnH5eKJZZhpDLXcFHbtZlZ9Y2WH4JuUn4iMwKM+L 5h4UhwSJQX1Dzcpu9kFgnH0k5sG/zXEnPOHjMa7ydwYD3thvXZ9EBJLRmuArVo+7Xp3K G5oJIDJFThNVJD7g+XOWQEmcIwPKtJjlLC8wdCzXa2sGwQ+ctdsa9zmwkGeeb4Q20z8i gRdw== X-Gm-Message-State: AOPr4FWhh0ysilV0xD80YqeRxFKzMXH7vHb3+sgV8Ets77cXGjbhhp9Xja/7IxVt1DWW5w== X-Received: by 10.55.221.24 with SMTP id n24mr6715255qki.149.1463274413959; Sat, 14 May 2016 18:06:53 -0700 (PDT) Received: from tlielax.poochiereds.net ([2606:a000:1125:4074:3a60:77ff:fe93:a95d]) by smtp.googlemail.com with ESMTPSA id d12sm11520330qhd.13.2016.05.14.18.06.53 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 14 May 2016 18:06:53 -0700 (PDT) From: Jeff Layton X-Google-Original-From: Jeff Layton To: Trond Myklebust , Anna Schumaker Cc: linux-nfs@vger.kernel.org, hch@infradead.org Subject: [PATCH v3 02/13] pNFS/flexfiles: When checking for available DSes, conditionally check for MDS io Date: Sat, 14 May 2016 21:06:31 -0400 Message-Id: <1463274402-17746-3-git-send-email-jeff.layton@primarydata.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1463274402-17746-1-git-send-email-jeff.layton@primarydata.com> References: <1463274402-17746-1-git-send-email-jeff.layton@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 From: Tom Haynes Whenever we check to see if we have the needed number of DSes for the action, we may also have to check to see whether IO is allowed to go to the MDS or not. [jlayton: fix merge conflict due to lack of localio patches here] Signed-off-by: Tom Haynes Signed-off-by: Jeff Layton --- fs/nfs/flexfilelayout/flexfilelayout.c | 5 ++--- fs/nfs/flexfilelayout/flexfilelayout.h | 1 + fs/nfs/flexfilelayout/flexfilelayoutdev.c | 6 ++++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index 51f6660a2247..f538ca6bbe81 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.c +++ b/fs/nfs/flexfilelayout/flexfilelayout.c @@ -1101,8 +1101,7 @@ static int ff_layout_async_handle_error_v4(struct rpc_task *task, rpc_wake_up(&tbl->slot_tbl_waitq); /* fall through */ default: - if (ff_layout_no_fallback_to_mds(lseg) || - ff_layout_has_available_ds(lseg)) + if (ff_layout_avoid_mds_available_ds(lseg)) return -NFS4ERR_RESET_TO_PNFS; reset: dprintk("%s Retry through MDS. Error %d\n", __func__, @@ -1764,7 +1763,7 @@ ff_layout_read_pagelist(struct nfs_pgio_header *hdr) return PNFS_ATTEMPTED; out_failed: - if (ff_layout_has_available_ds(lseg)) + if (ff_layout_avoid_mds_available_ds(lseg)) return PNFS_TRY_AGAIN; return PNFS_NOT_ATTEMPTED; } diff --git a/fs/nfs/flexfilelayout/flexfilelayout.h b/fs/nfs/flexfilelayout/flexfilelayout.h index 1318c77aeb35..b54058122647 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.h +++ b/fs/nfs/flexfilelayout/flexfilelayout.h @@ -191,4 +191,5 @@ nfs4_ff_find_or_create_ds_client(struct pnfs_layout_segment *lseg, struct rpc_cred *ff_layout_get_ds_cred(struct pnfs_layout_segment *lseg, u32 ds_idx, struct rpc_cred *mdscred); bool ff_layout_has_available_ds(struct pnfs_layout_segment *lseg); +bool ff_layout_avoid_mds_available_ds(struct pnfs_layout_segment *lseg); #endif /* FS_NFS_NFS4FLEXFILELAYOUT_H */ diff --git a/fs/nfs/flexfilelayout/flexfilelayoutdev.c b/fs/nfs/flexfilelayout/flexfilelayoutdev.c index 56296f3df19c..c52ca75081a8 100644 --- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c +++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c @@ -540,6 +540,12 @@ bool ff_layout_has_available_ds(struct pnfs_layout_segment *lseg) return ff_rw_layout_has_available_ds(lseg); } +bool ff_layout_avoid_mds_available_ds(struct pnfs_layout_segment *lseg) +{ + return ff_layout_no_fallback_to_mds(lseg) || + ff_layout_has_available_ds(lseg); +} + module_param(dataserver_retrans, uint, 0644); MODULE_PARM_DESC(dataserver_retrans, "The number of times the NFSv4.1 client " "retries a request before it attempts further "