Received: by 10.223.185.116 with SMTP id b49csp84495wrg; Thu, 15 Feb 2018 17:06:54 -0800 (PST) X-Google-Smtp-Source: AH8x227kQXiEWdv689+RT0zHcOsapJ/Bvu8HLi/qNltSCu8oX8Zpei/EoNc7WidKJgIrMZh8GyXd X-Received: by 10.101.78.12 with SMTP id r12mr3686830pgt.33.1518743214012; Thu, 15 Feb 2018 17:06:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518743213; cv=none; d=google.com; s=arc-20160816; b=dD/jD3wmbDCMOHPihXogccpcKGKOTj87vyo+VFIk0SIwIlv9Or8pbjL7k4olzvS0cp qmh92cIsovOTk0+/q1wOGaMtuRtLT326PVMUGFaZ2rHzC65De0lg6pOTlW7bBW/lU6cU V01JsOW7s9l5WSGuhpYrkpqJY7x2ynHomxanzoU9Z+xkLxXzQUhaz9QBujqNhbcUrZDZ MhXSq8yWkLKwo5vnJGv7Iln2DNtO1kC5Q/lJ7JtxTZPQ+cIpJVYbDV1TlJuuLfahbGcW wBhPYZAHI4HSSEWF0hidL+OZHdLmMHg5U5JGKoBbwK1mVqyUpRPcOsQDnl0EacUW5Pdr jeyw== 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=VZpFa72QY9UQ5OrsjcEGziuAlZZe8L/1RIp4pG3h8B4=; b=reQQaSsFu7jL1K1wCXK06FJVdZ4/ten/qsSsmoNhK3lcrt1vWXjSsrWeodWtsMzP3/ I8jwWlnU0Ux7ep+4dvjC3Dg9NXY3h9d/AxW3w02svjPC2Z1iVlQi4YX1n7OXz/ph3sxg f2wc/v7kbEnsFiENxAk/tjyMT9J0p60FwRhNvE2IEg3yEAajXGBLLpuJ2QQcpC6jJSeT Ax3LUottBRBmM+fn5/jcx4RWS+ec9W8dAbuiW36dBvkukQs5tCTlOMm7bKrVVC2y1EiI Bb1YH8sdC7UdEVNuj03BGCUeHd4WawvLrNcNdVrF7lHY7KkwgIUrs515eEYv5a7hUE/L NesA== 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 c21-v6si344401plo.46.2018.02.15.17.06.39; Thu, 15 Feb 2018 17:06:53 -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 S1424307AbeBOPnA (ORCPT + 99 others); Thu, 15 Feb 2018 10:43:00 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:33632 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424281AbeBOPm5 (ORCPT ); Thu, 15 Feb 2018 10:42:57 -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 79CF6110C; Thu, 15 Feb 2018 15:42:56 +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.15 097/202] nfs41: do not return ENOMEM on LAYOUTUNAVAILABLE Date: Thu, 15 Feb 2018 16:16:37 +0100 Message-Id: <20180215151718.430400589@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151712.768794354@linuxfoundation.org> References: <20180215151712.768794354@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.15-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;