Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2145601iof; Tue, 7 Jun 2022 21:16:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOssTokdttnZcHGiLryNExDVLYE5PJ573uFiuiHQCfFo+U6AN+UJoInpGrfJsuJsfT37B1 X-Received: by 2002:a63:c147:0:b0:3f5:f6f5:fe0e with SMTP id p7-20020a63c147000000b003f5f6f5fe0emr28227835pgi.501.1654661772264; Tue, 07 Jun 2022 21:16:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654661772; cv=none; d=google.com; s=arc-20160816; b=MU2jTJkSrp9paFTTMS9P3Plzca4TwUO17NsZXqqUqowh+jAD4J+NQSYJ3R3/TghHcw JMf3w0iqBIqYwfAZni33fPeiNVWOsdcWVea9RqzXA9e1+ueK12IqYMJqWpwtsywO/2zf ry2dapSnaMkjCxJHFe0QWy6RpKehoaYat2ee4L92bz9g/afSijDucQubCWiSZ7K7vZ++ BH/iqh3pecJBOlzLHGeaAlIEbHWTkfFY96jMuX3gPaYR316bm/y5vzAw2t62TyzJgIVG ac96ZJdQuD2iD+3RKg1lss5cVPglBsLVEFjoqqEpoFhVqK3knufbXb0uAr7MUgjDrhRy WSVg== 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=S3oMY/zAGLDoBvmwAq699+q5DdXS/nvucQM84zYwn/s=; b=mRYnaN+Qc+IdYJgigaF3mPCxPyLOF9P7PF5u1/H7JirfaYebJS7c8X1XORSVn9CScx BMJV/yPKWcisTOih/huRODnfTcf6sXg98QBa63WcAiHxEHP4Ibp6NFyzaAzA6outDAgI bodjkyuVAO1GcEuc92MbVyaPxii9cluOeoIN1j4oT0rx8n+nDbtk1J8ncPCTgBoahxDw CAYpFKO9qzyY3c/qtuvbhDsIhMOylq3EEalXbO3Rn/5ACe8eIlE0d/J1wRKWHuGqHjva pbBqCQrrEMjah6WUhhVmi6G9BpCj9p0wf+FVteVL1dWiayTgiuTUi+npUk9Px9MOK50Y 9+1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xXp+pUcs; 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 k22-20020aa792d6000000b0051854e7af02si25196571pfa.32.2022.06.07.21.16.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:16:12 -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=xXp+pUcs; 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 882422E2983; Tue, 7 Jun 2022 20:47:47 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235723AbiFGV3V (ORCPT + 99 others); Tue, 7 Jun 2022 17:29:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377911AbiFGUej (ORCPT ); Tue, 7 Jun 2022 16:34:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B51FA31357; Tue, 7 Jun 2022 11:36:46 -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 4B4D960B3D; Tue, 7 Jun 2022 18:36:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5ACD8C385A2; Tue, 7 Jun 2022 18:36:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654627005; bh=Isrj50lc5Yauj65VBJPnPgB3lYaeuB5jS9/qIuUOzVY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xXp+pUcs6dD4uwlqG1Eldq009M6UPOo0kX360AlEXYLdYhNEP3rp0ZXhMygsAiU7H Wbb9MVpF3i8uNQac/ufZFORM7agyv/Q3uCjZkf/OmqTUOPP6NXm1+qRWvNT60TB/uX wQpMjRX/X8Z0rs7fB3ItA7fwHBreE08QfAdA6308= 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.17 583/772] NFS: Do not report flush errors in nfs_write_end() Date: Tue, 7 Jun 2022 19:02:55 +0200 Message-Id: <20220607165006.127442996@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164948.980838585@linuxfoundation.org> References: <20220607164948.980838585@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 7e0ce50e04f6..832a97ed2165 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c @@ -391,11 +391,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