From patchwork Sun May 15 01:06:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 9095811 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 CA342BF29F for ; Sun, 15 May 2016 01:07:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F16962025A for ; Sun, 15 May 2016 01:07:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E606B20272 for ; Sun, 15 May 2016 01:07:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754024AbcEOBHH (ORCPT ); Sat, 14 May 2016 21:07:07 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:34696 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754018AbcEOBHD (ORCPT ); Sat, 14 May 2016 21:07:03 -0400 Received: by mail-qk0-f193.google.com with SMTP id i7so11334046qkd.1 for ; Sat, 14 May 2016 18:07:02 -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=rOLHk5Iw6cmLc75xRCvIfnqP9BvTL5Y04iezzjRPKr0=; b=ldEsq9hETNeC01p9uNQvjGxoXF5QroDLGT1GninGoxIf9k/HE9jPohUIV3TkFC3qvv gllJ80Kh9cM2HuBKzeTUey88EOLubeVT/uaN3vkTL7WTUZJbWfpLsoNbrLnGO1M3enSV hDxYSJrOJIH/THQInjaFrQ0gceBwBWQA90vqKqulXKwUP4DFpMTNLAMLroFo0P6CowJT uH46zagpitGzG6ON45b8kopS7DH+ABwaHFEXb73hw7fQ18PiJJsvRDfq3+PZ0VMkrj3r Dvp+dVawaDEmD3oGZE3ZiDHmmqXJD7Uhe47/qaApM5zUeyyDXmNILBMFV/JNz8H9cKMu BZrQ== 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=rOLHk5Iw6cmLc75xRCvIfnqP9BvTL5Y04iezzjRPKr0=; b=W3ee47uygzTQ2XXHHbb5VZVSVK+/DhK4biLDOhV0X0D3OLAv3TEQqENcvFtYYRM5fd ptjVo/EVXtNnyEljEZizGFImUmr979I2N+FBSBg0F4RCKU01gllosrKngSRMWRI9eY3C UenheM3EksLIQ3ZmSz/geAEefYez0P4rpoA0WA/3aXWii4AgdBPqiCFSf1e0At8E8lxR KKbd/BJml+MxWEjTO24iVs+T+WnRMxHy937IcLx250OB2Eahjhh9P7UN8vYcbBMDahku Jynow80XTTP79Sst/nBkxsboQuWTpQtb9F6eC3ZQg7lF6L9bTrSgTQkjqHF/jVvyrIgj oESQ== X-Gm-Message-State: AOPr4FUfB6idKlSu6U/U9UnGdsnP8dqnyNMMqErghs3YnE3wPxYyBgwx3k5eLcnDq+Qcpw== X-Received: by 10.55.23.29 with SMTP id i29mr15514057qkh.201.1463274421832; Sat, 14 May 2016 18:07:01 -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.07.00 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 14 May 2016 18:07:01 -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 10/13] pnfs: fix bad error handling in send_layoutget Date: Sat, 14 May 2016 21:06:39 -0400 Message-Id: <1463274402-17746-11-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 Currently, the code will clear the fail bit if we get back a fatal error. I don't think that's correct -- we only want to clear that bit if the layoutget succeeds. Fixes: 0bcbf039f6 (nfs: handle request add failure properly) Signed-off-by: Jeff Layton --- fs/nfs/pnfs.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index e6cad5ee5d29..5f6ed295acb5 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -876,11 +876,13 @@ 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))) + lseg = NULL; + } else { pnfs_layout_clear_fail_bit(lo, pnfs_iomode_to_fail_bit(range->iomode)); + } return lseg; }