Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1622125iob; Sat, 14 May 2022 14:55:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxx7+VmktWRUJRtorST99UERPKcxQpUb0hKPn3U2dubfJTCHGRhWmWBQ3sMSTbX1jHRSEcG X-Received: by 2002:a5d:584b:0:b0:20c:6317:1f77 with SMTP id i11-20020a5d584b000000b0020c63171f77mr8847428wrf.355.1652565356872; Sat, 14 May 2022 14:55:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652565356; cv=none; d=google.com; s=arc-20160816; b=PfX6v87N0Icu244rQ3DeOrHKyHiAbhTRnV33cz8z4gQOdMpZceiNT5csI00AKpJslo h6qfciBEHs/aqyR5ceo9gvAZdnrZ7fJT907ubtCC0QwhogrzwNKvWJPmSEma1Bm7G1+s jGNRphczrbohOgGPMCCseWElxlJHn2xRVJ6OJ8vL1s3Popu1bJQNHXNgFofe20C7izNq UZOcxgx+OQQ6yNCyS+GY36oUVndQ45rgrTPILpeyaUfPEIIxHY/0PH39V2eKLGEC986C 4H80P0FGJ7bxn1jNOH3q86fwTzgr651t8rFvGP1bbts9A6N0zuvo6W5NUcPZjIFQ5xRJ ny/w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wY+o3YeE4t8S5MguqsSeNyY1UcFwlk6KeRPnp2el7eg=; b=WGGyHVHz5qHGtNevOjPJ/ltMnfwfY81uOtN5e2FU2ZRux7SDuZY7aMaLd5r6IdxMZv R2H99xESboGvH/e5ehWACXLZ68HcQOGrvLkkAkAyd76oVhkn+eVOutJwLnHoMnhL0/ob SPr+V7W3kc0auL1vMa5qQBu/Wu9miilcMBsnRi1E3wBc4QDTEQTH00wwEnk3knBmMHVH gNwt3y6wXkl+lDVnzEHizVGXiPD8WJ1E7DauHWK95kOjEK6c2npXLGrI7KL5yr8UjVYm Ntxe4dcvxQI0IU0+OzjKaNGBx3L9uWsCTL+JaF22NHtuOWorsoYVwg2JSsDa4OEW20w2 GDuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Xn7HjV1t; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h22-20020a05600c351600b00396f9524a1esi2052230wmq.39.2022.05.14.14.55.19; Sat, 14 May 2022 14:55:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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=@kernel.org header.s=k20201202 header.b=Xn7HjV1t; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233336AbiENOdS (ORCPT + 99 others); Sat, 14 May 2022 10:33:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232498AbiENOdQ (ORCPT ); Sat, 14 May 2022 10:33:16 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0EB01C921 for ; Sat, 14 May 2022 07:33:14 -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 81BC5B808D5 for ; Sat, 14 May 2022 14:33:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DCD49C34118; Sat, 14 May 2022 14:33:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652538793; bh=XqCH6ObzSoxrvWct9VTFUaMTADQ3jzRx0P7yYzr2DdQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xn7HjV1tdQDxNAR5JqaxElMUWedoT/ndLxX2OUbw9PlyaeERP8vnwx1TNcuuphHqO kxDa3GYSvcB17stbRv+qGb17LK1MLXVi7X85YVD4P2tL/0yQNub0gB0/yFmQYOIebu hVwGVlcj1Y7bMPWMzX+Dgsg2Jg6I68ZMYc4B9nQfQrB3j4QH/tn6kjg8R2mtz3JM1F +vFY1Id3zJA9yBx5ufPndi8JNHtPYB0S55Rg6nmbhzZmrYb7+ARHLfnzQaBNvZG7Wq iO549TUqh+ptJ8bggCL1LCFyXDggj6tpsKamYZ+SvyfOqXqROv0nBlD1adLl0AVutO Oc8LMXto1a56Q== From: trondmy@kernel.org To: Anna Schumaker Cc: linux-nfs@vger.kernel.org Subject: [PATCH v3 4/5] NFS: Do not report flush errors in nfs_write_end() Date: Sat, 14 May 2022 10:27:03 -0400 Message-Id: <20220514142704.4149-5-trondmy@kernel.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220514142704.4149-4-trondmy@kernel.org> References: <20220514142704.4149-1-trondmy@kernel.org> <20220514142704.4149-2-trondmy@kernel.org> <20220514142704.4149-3-trondmy@kernel.org> <20220514142704.4149-4-trondmy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 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-nfs@vger.kernel.org From: Trond Myklebust 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 --- 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.36.1