Received: by 10.223.185.116 with SMTP id b49csp2300990wrg; Thu, 15 Feb 2018 09:29:20 -0800 (PST) X-Google-Smtp-Source: AH8x225BqZ0SWRqgStrMXZy8p6PCkfxaUcYGck4Mnx0NeJUuHHO96JUSFA5EoiX48W9EHar5vMPW X-Received: by 2002:a17:902:7182:: with SMTP id b2-v6mr3153855pll.331.1518715760302; Thu, 15 Feb 2018 09:29:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518715760; cv=none; d=google.com; s=arc-20160816; b=CA25R5L7knrP8nF6eaA+FPXDS+k1GyCIz90BeoA/czswlD8vnbCIbvoz63JHSePpft eVQQUfR++JmOL2MIdcHhkFjph3Z4ZLtGhU4tD2tGeo+J4/FxURQVE3TlIGGhlc4/iL5v zHmENj6/AgDYKdRv/5+CqMDwb7gjzaDm3HA6mqfVb093GVS6i8XMC7KYcPM8pBswupMn e1Ee4xpatN1iiO8/L7r0z5Zg0McJxGmSWWiBGbVVxnQd+rHmWXos9g2HCOWH3ZV1LyVr Rc5y0U9eQmka1Dqp9P15+NBZMEyufutoxSj+fIUtDaqSxRt5RZW4N4m4D7Q8PsC7b7su z2Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=e5E27cT65QOE2lF49OYEGEtlrri2Px8pK26XG4rpRYs=; b=T3ahqVw2rBmk7WRRHr8Y+7nnJ3WrFsJU614u5cpIUZRWCdbX878gOp3tVeFye5Irl1 zPGhoeqsdGw3DYANlIMdoZHR0MN2MrdqKeHeiihiBCFl9fS6o4FxxmrH9UmJvAdrvHAX 7PjjYmBftgmc38daXPV08/Q0bDsr9sVHUWoEBBDzXps9gSVnH74SL3Py/csMyxlzosO7 RzKaOsxQgT/2GkTdVHMueN72V/9whNORJDw13ALWAMWKJuutOyef9UiTjXEQ1/EkJ8Ip 5sL8VKzb78AIRVMfu13CVHE9bo5w4qGMzrj2FrJwaaWyM9UKf1EoEMPp2BRWeGx3iRNb mnqg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v22si10879pfd.22.2018.02.15.09.29.05; Thu, 15 Feb 2018 09:29:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1165054AbeBOPeM (ORCPT + 99 others); Thu, 15 Feb 2018 10:34:12 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:57098 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1165004AbeBOPeJ (ORCPT ); Thu, 15 Feb 2018 10:34:09 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D916D10FD; Thu, 15 Feb 2018 15:34:08 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tigran Mkrtchyan , Trond Myklebust Subject: [PATCH 4.14 104/195] nfs41: do not return ENOMEM on LAYOUTUNAVAILABLE Date: Thu, 15 Feb 2018 16:16:35 +0100 Message-Id: <20180215151710.892803902@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151705.738773577@linuxfoundation.org> References: <20180215151705.738773577@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tigran Mkrtchyan commit 7ff4cff637aa0bd2abbd81f53b2a6206c50afd95 upstream. A pNFS server may return LAYOUTUNAVAILABLE error on LAYOUTGET for files which don't have any layout. In this situation pnfs_update_layout currently returns NULL. As this NULL is converted into ENOMEM, IO requests fails instead of falling back to MDS. Do not return ENOMEM on LAYOUTUNAVAILABLE and let client retry through MDS. Fixes 8d40b0f14846f. I will suggest to backport this fix to affected stable branches. Signed-off-by: Tigran Mkrtchyan [trondmy: Use IS_ERR_OR_NULL()] Fixes: 8d40b0f14846 ("NFS filelayout:call GETDEVICEINFO after...") Signed-off-by: Trond Myklebust Signed-off-by: Greg Kroah-Hartman --- fs/nfs/filelayout/filelayout.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/fs/nfs/filelayout/filelayout.c +++ b/fs/nfs/filelayout/filelayout.c @@ -895,9 +895,7 @@ fl_pnfs_update_layout(struct inode *ino, lseg = pnfs_update_layout(ino, ctx, pos, count, iomode, strict_iomode, gfp_flags); - if (!lseg) - lseg = ERR_PTR(-ENOMEM); - if (IS_ERR(lseg)) + if (IS_ERR_OR_NULL(lseg)) goto out; lo = NFS_I(ino)->layout;