Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2288336iof; Wed, 8 Jun 2022 01:30:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6twybezSI94e0A5BowEB9tImyVsmb7/7yZCVpoyOK1PeiyerYybH4bhfcGW/sgMWEUeI3 X-Received: by 2002:a17:90a:4897:b0:1c7:5fce:cbcd with SMTP id b23-20020a17090a489700b001c75fcecbcdmr71790603pjh.45.1654677036625; Wed, 08 Jun 2022 01:30:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654677036; cv=none; d=google.com; s=arc-20160816; b=AsdfH4H+GVuhJy4E3ercRj9fgsMSZAadHTENOkPi/pFc7fhNtBVlf/kzwvBjOdCpmd AdDCEE0IFdRYCM5Ja/NzQSygDKBBoOryXKWvRobEP6VTjXWpJ4LkcecE5JqToEr7Dm7/ omH/2cBl8WrkYlvchx8cN8sGZ5wAZGDgNgnh6yS91Dmp7fXpSO0QL/IKblslZ8x+D/BI yb6jksFKxQfmnBRtLV7JPlLjJp3E/ggqip1kKpBVhh3BlmjNSD1fZRvuyKNPbLG0lWjL cwBs/kDGD53sr1VoOuFbKYLjveRar4V67wfKHAvzEGnsfegDRMdiNTB/EuT4CVLAZOxl miuQ== 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=1u4nfmF+Urwzsn3ySg7vOUW/0vyOy4i1hNgP5+WwAiA=; b=BW1Rkk1qPScQ153kR0dlel0x00+djkFgvKqE5Oz9cfg2os5hHZNHfIWHt0kW5OHRqZ 9IbDy5EJlHPqicCaSPDQokpzugebb1LEltKAIN4LftQRIL7MUo7Bbd/Eib+4yGC3F3yV Erv5WeQ0jcf88cXWX0Sbjj1E3kRe1uGPEH/KpfU/dK0/oldowEiihFo6KgMSLY5P6AeT Q9jqOc19GB4kx2QjGUcxRcahweC8dBHLrNx5hXU+JB7cTgkmD/a9PvoqgiE0lD2DfkHZ j67ywsMOUxjIvv0IDtxXAUv2xwzSh+P3QDUh02JCnwOOjs6sQEZ6ZIBuBd0TPz+Am/U6 oTrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TMXB0oeV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id u6-20020a17090341c600b001616793df50si26929166ple.263.2022.06.08.01.30.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 01:30:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TMXB0oeV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AEFD3344C9; Wed, 8 Jun 2022 00:59:07 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1392181AbiFHAzN (ORCPT + 99 others); Tue, 7 Jun 2022 20:55:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1383971AbiFGWJg (ORCPT ); Tue, 7 Jun 2022 18:09:36 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEFDD258DE9; Tue, 7 Jun 2022 12:18:50 -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 ams.source.kernel.org (Postfix) with ESMTPS id 90C96B8237B; Tue, 7 Jun 2022 19:18:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7547C385A2; Tue, 7 Jun 2022 19:18:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629524; bh=w4J3lZlhPnZx1YGLY7PoiF1tfVbazPE3XFhfXp2RXdQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TMXB0oeVNNEInxqiEXUi3CKhXuPGOm10CD09fub8fA4V0uTXiBZ598cnTEw098gU+ fqgA7JLRvdn6MzOoAzXYafcu3DPqLL0xJdUSYWvffJrgVxSL1kE206+mmg2JEzCWNR B7G/6m4c//reVnj+EwM0gKKbc7GAz5kW+7nREL+0= 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.18 681/879] NFSv4/pNFS: Do not fail I/O when we fail to allocate the pNFS layout Date: Tue, 7 Jun 2022 19:03:19 +0200 Message-Id: <20220607165022.614133384@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@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=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 856c962273c7..68a87be3e6f9 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -2000,6 +2000,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; @@ -2128,6 +2129,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