From patchwork Sun May 15 01:06:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 9095741 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 F02BA9F441 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 F150D2025A 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 0454320268 for ; Sun, 15 May 2016 01:07:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753995AbcEOBG5 (ORCPT ); Sat, 14 May 2016 21:06:57 -0400 Received: from mail-qk0-f196.google.com ([209.85.220.196]:35118 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753999AbcEOBG4 (ORCPT ); Sat, 14 May 2016 21:06:56 -0400 Received: by mail-qk0-f196.google.com with SMTP id n62so5069594qkc.2 for ; Sat, 14 May 2016 18:06:55 -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=xXr4+KhMAoJym7qu0psMVB806Vjls2xSMCDvcw0QCHg=; b=u+unjPIEJPxovFC3OwyXtmxOd0csMfcMuoA1e+kRbcfj+gVBKtRexY+y45O707FJOg 1fx6WG3nduyAq937rVL/wzpZocuXpyPosN2CgWcoS/gBLTKDkMQxvUjdiRetmZN1kNWR 0lYuODTkxIuJjy77a8ffNHcK9mo/RAMGylt734TA5rhvH25tfVnkvLDcHDeyNH4gF8s+ w8AkPhwCGUESpWukcyZyOmpJAv7Ewk7B0/pQl5/BnBI6KFm4lC8tdjO9bcZMcfXzmmmA Oz1TPd7PSlje5zlKhkdtwgP2OZEUKFEFxUcGPJlHuCMTf7xl9RHPLZKv644bb02LAYYy sLew== 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=xXr4+KhMAoJym7qu0psMVB806Vjls2xSMCDvcw0QCHg=; b=WIzuiVSG+Gn2dfevtc3bcDEqTsrgX7mNPVoiXdxMfvSYaz3jpWYOVX0h2UZMsRAuEG JIAf0YGNyCpddZX5+qwPtf9dBAZKZ01BJLKGlZr4XyKxWvKfAS3osqlfwxJZUKs33nJB icqJA9AszcT91ujZEZi0GqBGfvwI+eeK/y+ff8GmyET5sobyi8gLYHTLtm2lfTe5Lebm ddV5OmoVAlI5gp2q+FntV0+PI7wuntYoSiaZeh7afl3U6D/06Q7PmM0NWQmwlOrZXedH yx34zv3ychc3pJsOjK3C9DL5dtbI66WVTL2MKyrdiC54mh8Mv0Bp+8K2ZZEDllhMuxm0 vFPA== X-Gm-Message-State: AOPr4FUDVhzybElE0APZ64uLGwsETi8wX+gmpOwhsr7NywmIH0Xw7ninDtvUBIwon6AFDg== X-Received: by 10.55.18.96 with SMTP id c93mr15428471qkh.158.1463274414875; Sat, 14 May 2016 18:06:54 -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.54 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 14 May 2016 18:06:54 -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 03/13] pNFS/flexfiles: When initing reads or writes, we might have to retry connecting to DSes Date: Sat, 14 May 2016 21:06:32 -0400 Message-Id: <1463274402-17746-4-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 If we are initializing reads or writes and can not connect to a DS, then check whether or not IO is allowed through the MDS. If it is allowed, reset to the MDS. Else, fail the layout segment and force a retry of a new layout segment. Signed-off-by: Tom Haynes --- fs/nfs/flexfilelayout/flexfilelayout.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index f538ca6bbe81..f58cd2a14d5e 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.c +++ b/fs/nfs/flexfilelayout/flexfilelayout.c @@ -847,8 +847,13 @@ ff_layout_pg_init_read(struct nfs_pageio_descriptor *pgio, goto out_mds; ds = ff_layout_choose_best_ds_for_read(pgio->pg_lseg, 0, &ds_idx); - if (!ds) - goto out_mds; + if (!ds) { + if (ff_layout_no_fallback_to_mds(pgio->pg_lseg)) + goto out_pnfs; + else + goto out_mds; + } + mirror = FF_LAYOUT_COMP(pgio->pg_lseg, ds_idx); pgio->pg_mirror_idx = ds_idx; @@ -862,6 +867,12 @@ out_mds: pnfs_put_lseg(pgio->pg_lseg); pgio->pg_lseg = NULL; nfs_pageio_reset_read_mds(pgio); + return; + +out_pnfs: + pnfs_set_lo_fail(pgio->pg_lseg); + pnfs_put_lseg(pgio->pg_lseg); + pgio->pg_lseg = NULL; } static void @@ -904,8 +915,12 @@ ff_layout_pg_init_write(struct nfs_pageio_descriptor *pgio, for (i = 0; i < pgio->pg_mirror_count; i++) { ds = nfs4_ff_layout_prepare_ds(pgio->pg_lseg, i, true); - if (!ds) - goto out_mds; + if (!ds) { + if (ff_layout_no_fallback_to_mds(pgio->pg_lseg)) + goto out_pnfs; + else + goto out_mds; + } pgm = &pgio->pg_mirrors[i]; mirror = FF_LAYOUT_COMP(pgio->pg_lseg, i); pgm->pg_bsize = mirror->mirror_ds->ds_versions[0].wsize; @@ -917,6 +932,12 @@ out_mds: pnfs_put_lseg(pgio->pg_lseg); pgio->pg_lseg = NULL; nfs_pageio_reset_write_mds(pgio); + return; + +out_pnfs: + pnfs_set_lo_fail(pgio->pg_lseg); + pnfs_put_lseg(pgio->pg_lseg); + pgio->pg_lseg = NULL; } static unsigned int