Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2156647iof; Tue, 7 Jun 2022 21:39:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyA/1XBdNIOsVUCRfmedEhu1EeDDmLaFBXgZkLgwrY+SWS6FjOhQPhNTn9Kmoo6keKheu2k X-Received: by 2002:a17:902:f612:b0:14c:e978:f99e with SMTP id n18-20020a170902f61200b0014ce978f99emr32384552plg.23.1654663154504; Tue, 07 Jun 2022 21:39:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654663154; cv=none; d=google.com; s=arc-20160816; b=TActMqy1dgovMcanSiR2PWjBdDu0Umr2j/efjpP8d1eWX9bSM5/inhFohm5A0pD0rs yEOtmQabPAAHYScYg+rKTG7a7hVJry5eVVI5UQp/lnQn2h6C/+SmoTuHAwUnE58Wz0Yc p+UVPVtbbxm0ZCwwFZFCvijNhe6Ubd3WV1VEDtRojTvsj7VR8KucP75OEf13edBlgw/9 CVunTT/X2qJHhHSlwSW7+QhCNtIqMqbMBrGZ2DureRWB70EcWCMKFT2/lk3ErxJ/pmXb plFwWdF1mV6DemIJmqO/G1JbE47plDkj0Wx6VX8UQMLplhUeXgYnylCQVjp4D9rEY1Ig iVkg== 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=Ntl5A0hIeC70MN11lSzJVgH+ujm/chueDumbJ3AE/4w=; b=DwgzS7+AFERFEirTk+IJyO1PgOL6T0bruiuC6JxLcQImCp4GqM65eWQ2ngbi6leiM7 rknqnG9ZBSTmjaCTiyJ0nGILB6G97Y16pL6JY/oz4zYUbQy12UtZcqcxebwz1xFnhchE +rBglaMohnCnVmR8ZK793HPQIwjaTu4yW2NZGLdRoErfHg4dltyEf/S3xa5CWvwXS0JV wvZJ9F0HPg7nO03yNslofmqnCB3dzG7q+4v5joNxCG9OyIc08bz18Gv+TG9u8mZP4nA/ L/XNb+tmFkxuQOvJWxyw4CKEqI8QOsG8NGKhggl+/jSyY3AQ5cC/WrdgOEUYAy2FJR3G cRTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TlHkrWQl; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id e5-20020a170902784500b0016399622169si31787554pln.46.2022.06.07.21.39.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:39:14 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TlHkrWQl; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 60CDA28D68D; Tue, 7 Jun 2022 21:07:31 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349311AbiFGSAG (ORCPT + 99 others); Tue, 7 Jun 2022 14:00:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348412AbiFGRkt (ORCPT ); Tue, 7 Jun 2022 13:40:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 626FC11CB49; Tue, 7 Jun 2022 10:34:13 -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 CB65C6157D; Tue, 7 Jun 2022 17:33:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD48FC385A5; Tue, 7 Jun 2022 17:33:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654623222; bh=r+PiPBr4xTAxxMb9zWAk9Kk81bO+/sVjicksRNPqiGI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TlHkrWQlUdxp1ge34B9ZjzrhN7cA9rjuvZq4FoC6evka4ELCoM3+a8jVfByZHwiVQ UKkIzSvzGAogpobzWoMn2cnsLi1ZjDpb2EvS2oR6dm5stwkvM9q6kvbG70KtQpsU/3 apCZujA2ZMX54oTQ7ulL7431yJpP13cVQDyQ1fkA= 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.10 332/452] NFSv4/pNFS: Do not fail I/O when we fail to allocate the pNFS layout Date: Tue, 7 Jun 2022 19:03:09 +0200 Message-Id: <20220607164918.452934740@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164908.521895282@linuxfoundation.org> References: <20220607164908.521895282@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 b3b9eff5d572..8c0803d98008 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -2006,6 +2006,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; @@ -2134,6 +2135,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