Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp447149iog; Mon, 13 Jun 2022 06:09:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7uuV7xmBCKNEZfuVOzexVtThOYZljz/SZmMLWuIk8WaHhjNzkVRjnrEJFho0TCCD4iLtQ X-Received: by 2002:a05:6402:3293:b0:42e:18a:d6eb with SMTP id f19-20020a056402329300b0042e018ad6ebmr65238360eda.293.1655125657313; Mon, 13 Jun 2022 06:07:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125657; cv=none; d=google.com; s=arc-20160816; b=DLmPCvoEpyDF5cGtqq+J2ZY+3r/fwLl9smZqmLQrqzEpXHPa9Da3WsZTqYmDuHnCBC Um+ukJ8lOpbtALtJa3jqar7ysIwj/GnFWdZed5LzQWZWl9aDqxK/uJNqOiq3p5fDMyGP w9nU//lRMzbWt9B9ZfkRnuylguOpGxgEFTgHu3jxuequ7Z2hGbaqBl8YQEUslcOpQB+g kPeFSfcu1yRt7iBxsT9r/Disr96ikhIcB4DQXfZfn9B9+c22VAI+jCgd5gJmylwwlXYM 36ryx4GXkIi6iFv0v5uTny1kL3n2hwy9hFUwQrIicuwHHCO3fdv3HY/ko9wf/jttNcAd UHuw== 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=8o28KAp+vU2cLADMvU7VgXPd0xCXwJfbtCfixraJMhg=; b=khUYSrBfp554jOlroXuA3yEiNXzJvn+VTc3QZ7Uy0uQjKHuvo/5rGs4bZ0hzQ4PUCq 5sw7Yh7tan+5/2SF4Qgi33w8Vyp7egi+gpMSwM42nRqgNj1v5wmnajI+OYUD74b1c8nB /y7mNUm/avx7mYmpcMGEMwrC02ItzO0ees/fXlQQVJP7VNPZ3x94uxokv6KjFnDBm3fL IVSJpQHji+k9NSffQ0dxSmyX5oJucgNCc4q9E+ImXShU1TjwJI7a+wMGIPM1ZBdfGIGZ XBsmsad1wp3Juofo6phIJIcN7RezmGIjgl/ihhPfECZae56wmGN+32427AFPqiFXujj2 TeRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=f4EYZU0S; 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 cw11-20020a170906478b00b00711efd98320si9258717ejc.241.2022.06.13.06.07.11; Mon, 13 Jun 2022 06:07:37 -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=f4EYZU0S; 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 S1353922AbiFMLZ5 (ORCPT + 99 others); Mon, 13 Jun 2022 07:25:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353273AbiFMLTi (ORCPT ); Mon, 13 Jun 2022 07:19:38 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90B4B3A70D; Mon, 13 Jun 2022 03:41:08 -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 86057B80EAA; Mon, 13 Jun 2022 10:41:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00B18C34114; Mon, 13 Jun 2022 10:41:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655116865; bh=sORjXoBmpNc33OPcD4TrVdybWlMbn5lGfpHxkTVJosw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f4EYZU0SVYqP83ypq3UvAPXsiYACL2xL22XT1Abu9fNdKdncn9Jb1SJxYM5fM+iDu 4V/vgrolELrBi1gpfDugKhGP5M6d6NFMx4H3u3su9nL6XTj1VMPuw7ZDGdUlOlI+Su lYs8K5BSRd1mTZIbKq2sQScThCDklvwzG3pREUnQ= 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.4 201/411] NFS: Do not report flush errors in nfs_write_end() Date: Mon, 13 Jun 2022 12:07:54 +0200 Message-Id: <20220613094934.686750817@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 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 73415970af38..3233da79d49a 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c @@ -394,11 +394,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