Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2193436iof; Tue, 7 Jun 2022 22:47:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGd0761KF+sMiN5jOQRI39hTqxOx4JR9MzLhNaXoV8AkW8wepMjj05lXiUh3ya0VDglBed X-Received: by 2002:a17:902:b282:b0:163:ffe6:2cf9 with SMTP id u2-20020a170902b28200b00163ffe62cf9mr33006107plr.76.1654667230216; Tue, 07 Jun 2022 22:47:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654667230; cv=none; d=google.com; s=arc-20160816; b=YKiTq/Se0TI9vZTlaLZYFlc5ELQnFa5vJ3CTVqo/po2lInB1Ujv1pIiKCvPkxYft0C pt6bQOtU1p/a14iAYebhEexx74p8INSt06vDMXJF+zAnOWGXh3vx1kXX2k5l57xDckKP kqV7QcEDMWtdIXPi8/pqAXMIeD51lxJyI0+LM/Erj/sUze9gF5Yus1nRMua0uR7i5VMK OAB+ONAb3eQg2Ry1vNDtwX23PhF/jp6ece1MXxOTz8S2y16UljQZR9LH6sydK6Bm/9Gi SE/kxtKOq5wtDUuD0/47v0ATVVbkeuv0B00OuX9jI7g14NM+StpbWts6ixv/2a4UeT8e BRCg== 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=2IKZq8r2nG+DeQhuiD9WidvIo9E0zzqEJyWemqPn/0I=; b=GXjVgPL8fblntxscNGTgZzBtSvKVIPww3bUc14Yad6QdHAnKHiP09Xlt8xshOKGPiG 7lLdr54Xv6kSHIzDlIztuNe/233tv+e0iB72GO7/9kHfjBFZw/OuqhYEvZKfDFwQAVCe DDqUQ/grfY35/+ZV5mycyiOClJbux51OJAhrjmpqvDmI0Hq6wUk2Gl2fKyeGFeR39wZ2 lIvVq71gdM8JFRQlydD1PnbT5TxSVQCsejHKGV6aqKBWfV5oEG3f5qVAwxofCl3JqThx aK3kXykwWMmYbyJas8b+v8LuVgKcZ4ogJqOJtjCvzduucB7drX4EdEzxLtyFhpu18t2T juGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lgfpTuzh; 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 d14-20020a170902cece00b0016397d8ddeesi31129021plg.517.2022.06.07.22.47.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:47:10 -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=lgfpTuzh; 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 104BD212D90; Tue, 7 Jun 2022 22:11:57 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387051AbiFHAWy (ORCPT + 99 others); Tue, 7 Jun 2022 20:22:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1383781AbiFGWIU (ORCPT ); Tue, 7 Jun 2022 18:08:20 -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 ADE68256958; Tue, 7 Jun 2022 12:18:39 -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 745AE61937; Tue, 7 Jun 2022 19:18:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B540C385A2; Tue, 7 Jun 2022 19:18:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629518; bh=q/qGVdP1QmculnLBqOY5CtVe3ahdbNWzYw2U/xURrBU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lgfpTuzh+JmSKYIFKQhcyDrwkaTeQodHGglTLxCyKT6vKp7Wnp6/sfC8KPXF5k8MG FI2YzCrfdzYyRswiWhkWRineDCdnU2/YelAm40ZPul3LlsTEUuxRSH7kTcZnmhYacx upLloTcsNRh2orilBmIwn97z0syg20fZ/amkPFzU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Trond Myklebust , Anna Schumaker , Sasha Levin Subject: [PATCH 5.18 679/879] NFS: Do not report flush errors in nfs_write_end() Date: Tue, 7 Jun 2022 19:03:17 +0200 Message-Id: <20220607165022.556269950@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 d95b26650e86175e4a97698d89bc1626cd1df0c6 ] If we do flush cached writebacks in nfs_write_end() due to the imminent expiration of an RPCSEC_GSS session, then we should defer reporting any resulting errors until the calls to file_check_and_advance_wb_err() in nfs_file_write() and nfs_file_fsync(). Fixes: 6fbda89b257f ("NFS: Replace custom error reporting mechanism with generic one") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin --- fs/nfs/file.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 87e4cd5e8fe2..3f17748eaf29 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c @@ -386,11 +386,8 @@ static int nfs_write_end(struct file *file, struct address_space *mapping, return status; NFS_I(mapping->host)->write_io += copied; - if (nfs_ctx_key_to_expire(ctx, mapping->host)) { - status = nfs_wb_all(mapping->host); - if (status < 0) - return status; - } + if (nfs_ctx_key_to_expire(ctx, mapping->host)) + nfs_wb_all(mapping->host); return copied; } -- 2.35.1