Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp442259iog; Mon, 13 Jun 2022 06:05:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1lVy7NKzrBWkfU+iUSgpwWOPwzFNgkPRowqkRsEiaiYfKCnCKomqhSrkbumcL5b4P2X41 X-Received: by 2002:a17:902:820d:b0:168:d5e9:c4fb with SMTP id x13-20020a170902820d00b00168d5e9c4fbmr8159784pln.128.1655125544925; Mon, 13 Jun 2022 06:05:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125544; cv=none; d=google.com; s=arc-20160816; b=r5FoMHwOp0YtHO913UXPiW6daq3gFpFqGJbR7QYkgiY3S/jl4fiOCb7Z22smLq9h72 tKKIj9Vjf0wM77nKKAoUtVxAlm6hcNxdPnaDpc5aROetotNAi0KGSsFSm1zhH+/eJWDZ qTJMS5fDWoHLisgYbzf4JcuBgddR73wxSqYy/wEMWcfxh8N+Csb7y6Cj3g/GM3l+Euax tXKnUh3tK0axcfLulc5GGkNf9qItfXqonQiKhdnNegZehtiFd6kPmLm62RI/EI+NHZC8 20Thy6YBuDAZUZ6jXfF7EVP2HXKgRP03NXSl79EB4DD/ELSIbWsVrFBi9nRaO2N7eR5g qzHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0tMMVBRP5xUmVkFB6mb8il/iBJl9ICHXSNCQtJsmW9E=; b=al25uvHDr15Sybb4Cg6NPUEjS/Pq0JrsoE8x43+sWGSqJBeSZAeL71XU5tZZ/JKFbu HwGPuibHy/F2RBZ7ikNSZHs4r+d8vpTz6i7jPkUi/PXUzXS7sbfKngjKELvw+68ECGB2 hhSP9ITu+fwNPZbCXU0qVjipWJdNxeErwJAmmHDBSfvW609kM7WEA5s/itmrjce//hW5 pi/AdxMNFvJiD1xFrRjQ8T7Gqz5I3mn6nWOeWC0SkWC9K+CccI8d0jeA9krZcLiJrKD/ ++Rr5c1RDlLMr0uP/nusJQ2HH7qgRimHvsYTgQ9YD2VBnVXkyps7lPIYrFilGhOVCKMw KVQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xPsDoHda; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b16-20020a170902d51000b0015eb08a71a6si10677168plg.16.2022.06.13.06.05.27; Mon, 13 Jun 2022 06:05:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xPsDoHda; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353940AbiFML0J (ORCPT + 99 others); Mon, 13 Jun 2022 07:26:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353349AbiFMLTk (ORCPT ); Mon, 13 Jun 2022 07:19:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72BF43AA51; Mon, 13 Jun 2022 03:41:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 759FB60FDB; Mon, 13 Jun 2022 10:41:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80E20C3411C; Mon, 13 Jun 2022 10:41:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655116870; bh=JBdysYnTCOqo85vNwlQFdf3X2vArao3AMOxh5xGOC+w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xPsDoHdaEzoYQV/7hhZfGcKybFS1sI5fryhc6tqDCydlR8DEXQyQOcLzmoZlzY7Rj TkBgGHkVNbrxqoxQT/38tDrX2FPQ0u67Hpw+URuQFbabBoo2CA39msluAKtNyvdNH/ gZXGmhR27JjLTnWCkWd1wSdr+f0il1gy9jXvzRX0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Olga Kornievskaia , Trond Myklebust , Anna Schumaker , Sasha Levin Subject: [PATCH 5.4 203/411] NFSv4/pNFS: Do not fail I/O when we fail to allocate the pNFS layout Date: Mon, 13 Jun 2022 12:07:56 +0200 Message-Id: <20220613094934.746280586@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094928.482772422@linuxfoundation.org> References: <20220613094928.482772422@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Trond Myklebust [ Upstream commit 3764a17e31d579cf9b4bd0a69894b577e8d75702 ] Commit 587f03deb69b caused pnfs_update_layout() to stop returning ENOMEM when the memory allocation fails, and hence causes it to fall back to trying to do I/O through the MDS. There is no guarantee that this will fare any better. If we're failing the pNFS layout allocation, then we should just redirty the page and retry later. Reported-by: Olga Kornievskaia Fixes: 587f03deb69b ("pnfs: refactor send_layoutget") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin --- fs/nfs/pnfs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 0471b6e0da16..2fe48982fbb4 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -1961,6 +1961,7 @@ pnfs_update_layout(struct inode *ino, lo = pnfs_find_alloc_layout(ino, ctx, gfp_flags); if (lo == NULL) { spin_unlock(&ino->i_lock); + lseg = ERR_PTR(-ENOMEM); trace_pnfs_update_layout(ino, pos, count, iomode, lo, lseg, PNFS_UPDATE_LAYOUT_NOMEM); goto out; @@ -2090,6 +2091,7 @@ pnfs_update_layout(struct inode *ino, lgp = pnfs_alloc_init_layoutget_args(ino, ctx, &stateid, &arg, gfp_flags); if (!lgp) { + lseg = ERR_PTR(-ENOMEM); trace_pnfs_update_layout(ino, pos, count, iomode, lo, NULL, PNFS_UPDATE_LAYOUT_NOMEM); nfs_layoutget_end(lo); -- 2.35.1