From patchwork Tue May 17 16:28:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 9114301 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 0465F9FB14 for ; Tue, 17 May 2016 16:29:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2481F201B9 for ; Tue, 17 May 2016 16:29:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4C4E4202EC for ; Tue, 17 May 2016 16:29:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756205AbcEQQ3J (ORCPT ); Tue, 17 May 2016 12:29:09 -0400 Received: from mail-qg0-f66.google.com ([209.85.192.66]:33122 "EHLO mail-qg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756202AbcEQQ3H (ORCPT ); Tue, 17 May 2016 12:29:07 -0400 Received: by mail-qg0-f66.google.com with SMTP id 90so1830913qgz.0 for ; Tue, 17 May 2016 09:29:06 -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=fee72laGJujHDGD4hB2TEvznbv7KzHXGV704kO8lyoI=; b=AoABGgxZtXFbv1jo4PUVF2Y8dw5Hr3FMBPW5OwxJAVDDSALuzRI49fEHzkvWhL8i+5 oIlXyv/sF2eMVesxWuvTy4O5jsMtHainBunzDhqiyEKsl7h9Mo3ir8Y0ANCknxnz/N2V 3fU2RdQMMm2EnB8inou9bdapvit+q73WeyejmCzn9DtdHqymipkKLCmk0muhgJhDP1tr hYoCmjVfVrCF8EibA2UDCnKgrJ5MyEOppsYJaX5eOwJrJu1Sllie6vfPWqabC2hFEJes uuynqp7MSlesUGwytZZhdTmUBw/6DD6JcWKgKMSgfGcTWgxMqh8m03NVwi1ctDDF/Tgm B8Vg== 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=fee72laGJujHDGD4hB2TEvznbv7KzHXGV704kO8lyoI=; b=nOf4JOvnEf4GKeQT4TLu7ZGWeWVcBXg+mz/XsyYLFrKCqFAX/TQU5JMQgJpI9ljR5C WQQj3Ejmy5XeXiKLEAtxlWq+Z+UpDapIyFVWaSx+9AXJuwdIQ8fg3tQUPJWTy8b6riHq hte8qzwbt0vQvgRBfwgwtRcltnMd81MkJiblVNJx4rjoz+71l3oM1tHWdlkHUEUq/k9Q f5lP3MHUkn3hRJMZVwSiFwvE4n/DaNVUhf9UTNtyQlNv5qoIGghCHH3FDy6fsiMEBDhh rzUNJJYXYDOj+/rdi00szmL48B4FXI5gGHyJDKs9OulSxYBbybngmwksYmOZos3n28y3 aCDw== X-Gm-Message-State: AOPr4FW/pJ8mtCY1jmlnbOxsgKzLsW97cyffIOc/FCi09g1FjtXRjZoY8EmJHTb+58v8RQ== X-Received: by 10.140.92.237 with SMTP id b100mr2483183qge.88.1463502546156; Tue, 17 May 2016 09:29:06 -0700 (PDT) Received: from tlielax.poochiereds.net ([2606:a000:1125:4074:3a60:77ff:fe93:a95d]) by smtp.googlemail.com with ESMTPSA id a31sm1685827qga.34.2016.05.17.09.29.04 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 May 2016 09:29:04 -0700 (PDT) From: Jeff Layton X-Google-Original-From: Jeff Layton To: Trond Myklebust , Anna Schumaker Cc: Thomas Haynes , linux-nfs@vger.kernel.org, hch@lst.de Subject: [PATCH v4 10/13] pnfs: fix bad error handling in send_layoutget Date: Tue, 17 May 2016 12:28:45 -0400 Message-Id: <1463502528-11519-11-git-send-email-jeff.layton@primarydata.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1463502528-11519-1-git-send-email-jeff.layton@primarydata.com> References: <1463502528-11519-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 Currently, the code will clear the fail bit if we get back a fatal error. I don't think that's correct -- we want to clear that bit if we do not get a fatal error. Fixes: 0bcbf039f6 (nfs: handle request add failure properly) Signed-off-by: Jeff Layton --- fs/nfs/pnfs.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index e6cad5ee5d29..eb90b3af3446 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -876,11 +876,16 @@ send_layoutget(struct pnfs_layout_hdr *lo, lseg = nfs4_proc_layoutget(lgp, gfp_flags); } while (lseg == ERR_PTR(-EAGAIN)); - if (IS_ERR(lseg) && !nfs_error_is_fatal(PTR_ERR(lseg))) - lseg = NULL; - else + if (IS_ERR(lseg)) { + if (!nfs_error_is_fatal(PTR_ERR(lseg))) { + pnfs_layout_clear_fail_bit(lo, + pnfs_iomode_to_fail_bit(range->iomode)); + lseg = NULL; + } + } else { pnfs_layout_clear_fail_bit(lo, pnfs_iomode_to_fail_bit(range->iomode)); + } return lseg; }