From patchwork Mon Apr 11 21:33:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 12809673 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B920FC433FE for ; Mon, 11 Apr 2022 21:40:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237048AbiDKVmx (ORCPT ); Mon, 11 Apr 2022 17:42:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237081AbiDKVmw (ORCPT ); Mon, 11 Apr 2022 17:42:52 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E36633A39 for ; Mon, 11 Apr 2022 14:40:37 -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 262A6B818C8 for ; Mon, 11 Apr 2022 21:40:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73CA2C385A3; Mon, 11 Apr 2022 21:40:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649713234; bh=XDyu0lsurJEAhJLJoQZYLGFV2g+T+Pe+yv9mizVz8CE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kXdS9NohGJiEVNlCCjWhfekeVVcq0mBvbFhHMzV7tStyMCBxKwmHvU0bRraY6kIYE +1NnSdWi7sAJA2rD+5PNzxHA942z6aEJcmIl8FjfrHCeL1YflGi4GHCU8AOCAGu8j6 OVhJRtwMv695F9CyPLduWkEjNmX20Bycw2aLR+a4NakeSCWWl0R/J7US+ALUQTXixa OK3ZobBB9HyuDV0hiCk6WvHRNrj4LXamDdIXkZCSlAGOX6jed3/YqHtGnsyCiFcJxN KApxG4hsSI7cke3DqfeFrXykx8VXenoK+DzBjC1qZUPmPDxdpuDbQ1FHEJgCf/dFWy MZ3Jn3u06vMrg== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Cc: ChenXiaoSong , Scott Mayhew Subject: [PATCH v2 1/5] NFS: Do not report EINTR/ERESTARTSYS as mapping errors Date: Mon, 11 Apr 2022 17:33:42 -0400 Message-Id: <20220411213346.762302-2-trondmy@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220411213346.762302-1-trondmy@kernel.org> References: <20220411213346.762302-1-trondmy@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Trond Myklebust If the attempt to flush data was interrupted due to a local signal, then just requeue the writes back for I/O. Fixes: 6fbda89b257f ("NFS: Replace custom error reporting mechanism with generic one") Signed-off-by: Trond Myklebust --- fs/nfs/write.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/write.c b/fs/nfs/write.c index e864ac836237..9d3ac6edc901 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -1436,7 +1436,7 @@ static void nfs_async_write_error(struct list_head *head, int error) while (!list_empty(head)) { req = nfs_list_entry(head->next); nfs_list_remove_request(req); - if (nfs_error_is_fatal(error)) + if (nfs_error_is_fatal_on_server(error)) nfs_write_error(req, error); else nfs_redirty_request(req); From patchwork Mon Apr 11 21:33:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 12809675 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07833C433F5 for ; Mon, 11 Apr 2022 21:40:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344791AbiDKVmz (ORCPT ); Mon, 11 Apr 2022 17:42:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350070AbiDKVmx (ORCPT ); Mon, 11 Apr 2022 17:42:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C7EE338AB for ; Mon, 11 Apr 2022 14:40:38 -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 ED24FB815C8 for ; Mon, 11 Apr 2022 21:40:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C2B8C385A9; Mon, 11 Apr 2022 21:40:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649713235; bh=Q0sQqucLrEsfxJiDJRj0jf8k0wqNqcX5dWyoVIv+DIs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HsXUkcYuUgsP1jlK+RBMJ+l2CDqWtXiQ6sINn7yCycmpquiBYAS2V9xsOVnN8ySpk Y5js3q4szaVZbi8m+bezc6zI1hoYQtGp1GpTDYi0RkMC6T0P69f0PNSeTp4YIV6V6y 5/efoCT8QHDV60Dn72PMqEFmKALNvTQ+cyfo6GrDMWt8XIcHoWoogiAOzF6DomneKw 5yYym2Ax31bNiz6OPOk6DP8V/Sme7A/nsPBKdYN0mOAAZYAS9plmWQ+GEhUKlP4yYu UGk8cRb575n3UFniAGpYDw4y+Wq5JX9VIKuuJH+OoEiRbNMSa96PAOArMWcab0UkAL J/MhzH4WXdXKQ== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Cc: ChenXiaoSong , Scott Mayhew Subject: [PATCH v2 2/5] NFS: fsync() should report filesystem errors over EINTR/ERESTARTSYS Date: Mon, 11 Apr 2022 17:33:43 -0400 Message-Id: <20220411213346.762302-3-trondmy@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220411213346.762302-2-trondmy@kernel.org> References: <20220411213346.762302-1-trondmy@kernel.org> <20220411213346.762302-2-trondmy@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Trond Myklebust If the commit to disk is interrupted, we should still first check for filesystem errors so that we can report them in preference to the error due to the signal. Fixes: 2197e9b06c22 ("NFS: Fix up fsync() when the server rebooted") Signed-off-by: Trond Myklebust --- fs/nfs/file.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 81c80548a5c6..95e1236d95c5 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c @@ -204,15 +204,16 @@ static int nfs_file_fsync_commit(struct file *file, int datasync) { struct inode *inode = file_inode(file); - int ret; + int ret, ret2; dprintk("NFS: fsync file(%pD2) datasync %d\n", file, datasync); nfs_inc_stats(inode, NFSIOS_VFSFSYNC); ret = nfs_commit_inode(inode, FLUSH_SYNC); - if (ret < 0) - return ret; - return file_check_and_advance_wb_err(file); + ret2 = file_check_and_advance_wb_err(file); + if (ret2 < 0) + return ret2; + return ret; } int From patchwork Mon Apr 11 21:33:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 12809672 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5F32C433EF for ; Mon, 11 Apr 2022 21:40:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234533AbiDKVmx (ORCPT ); Mon, 11 Apr 2022 17:42:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237048AbiDKVmw (ORCPT ); Mon, 11 Apr 2022 17:42:52 -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 4A41033A0F for ; Mon, 11 Apr 2022 14:40:37 -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 DAA9D61701 for ; Mon, 11 Apr 2022 21:40:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8E59C385AB; Mon, 11 Apr 2022 21:40:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649713236; bh=t0ZdTuVnz8eqy1TWWnBl4rDn04/xaH24HuwOHJeHyjY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XmfVptnuX3Sb90CY9ASv4XrpNl0lvrEb2jNYjnIPCCYo6RTq5HvTfI1UffkPjoRRO dKWTgWJNdz4OqFdrTTLoHZT7isNfYZ9L+Ssxz1GB5tX0cRMB94u7404f9TzYxnl/zG rcBst5X05PX6jIgddpnk8yl3488M8Anor3mEdkjXFgmIKKBtatQL8BX1XMSwiBuL0D 3EGFGXI8z71trdvgr7/3F/QI5FiiMeeUnMwdDj0hSj4nzUXl/1ORb/fSE7vO54raad k3RTmmICfneZa0m3IELtwdP0iEiielTsSPjaCqmYTfI8CDB5gnfetqJBjPc1OBeS9w xUI8kHh7PbBNw== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Cc: ChenXiaoSong , Scott Mayhew Subject: [PATCH v2 3/5] NFS: Don't report ENOSPC write errors twice Date: Mon, 11 Apr 2022 17:33:44 -0400 Message-Id: <20220411213346.762302-4-trondmy@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220411213346.762302-3-trondmy@kernel.org> References: <20220411213346.762302-1-trondmy@kernel.org> <20220411213346.762302-2-trondmy@kernel.org> <20220411213346.762302-3-trondmy@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Trond Myklebust Any errors reported by the write() system call need to be cleared from the file descriptor's error tracking. The current call to nfs_wb_all() causes the error to be reported, but since it doesn't call file_check_and_advance_wb_err(), we can end up reporting the same error a second time when the application calls fsync(). Note that since Linux 4.13, the rule is that EIO may be reported for write(), but it must be reported by a subsequent fsync(), so let's just drop reporting it in write. The check for nfs_ctx_key_to_expire() is just a duplicate to the one already in nfs_write_end(), so let's drop that too. Reported-by: ChenXiaoSong Fixes: ce368536dd61 ("nfs: nfs_file_write() should check for writeback errors") Signed-off-by: Trond Myklebust --- fs/nfs/file.c | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 95e1236d95c5..8211a7aa799c 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c @@ -598,18 +598,6 @@ static const struct vm_operations_struct nfs_file_vm_ops = { .page_mkwrite = nfs_vm_page_mkwrite, }; -static int nfs_need_check_write(struct file *filp, struct inode *inode, - int error) -{ - struct nfs_open_context *ctx; - - ctx = nfs_file_open_context(filp); - if (nfs_error_is_fatal_on_server(error) || - nfs_ctx_key_to_expire(ctx, inode)) - return 1; - return 0; -} - ssize_t nfs_file_write(struct kiocb *iocb, struct iov_iter *from) { struct file *file = iocb->ki_filp; @@ -637,7 +625,7 @@ ssize_t nfs_file_write(struct kiocb *iocb, struct iov_iter *from) if (iocb->ki_flags & IOCB_APPEND || iocb->ki_pos > i_size_read(inode)) { result = nfs_revalidate_file_size(inode, file); if (result) - goto out; + return result; } nfs_clear_invalid_mapping(file->f_mapping); @@ -673,17 +661,22 @@ ssize_t nfs_file_write(struct kiocb *iocb, struct iov_iter *from) } result = generic_write_sync(iocb, written); if (result < 0) - goto out; - + return result; +out: /* Return error values */ error = filemap_check_wb_err(file->f_mapping, since); - if (nfs_need_check_write(file, inode, error)) { - int err = nfs_wb_all(inode); - if (err < 0) - result = err; + switch (error) { + default: + break; + case -EDQUOT: + case -EFBIG: + case -ENOSPC: + nfs_wb_all(inode); + error = file_check_and_advance_wb_err(file); + if (error < 0) + result = error; } nfs_add_stats(inode, NFSIOS_NORMALWRITTENBYTES, written); -out: return result; out_swapfile: From patchwork Mon Apr 11 21:33:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 12809674 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 798F8C4332F for ; Mon, 11 Apr 2022 21:40:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237081AbiDKVmy (ORCPT ); Mon, 11 Apr 2022 17:42:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344791AbiDKVmw (ORCPT ); Mon, 11 Apr 2022 17:42:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C530633A3A for ; Mon, 11 Apr 2022 14:40:37 -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 3F5F561704 for ; Mon, 11 Apr 2022 21:40:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 906E7C385A3; Mon, 11 Apr 2022 21:40:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649713237; bh=qPudaQAYHUtYnkzoLgfPWcStuGfd0CEvlH41urmdpiI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aXIQedSNy6UQIAPF7o4Xj0qLk+OvHZepSpOsSunh2Wyb5GfacjFL8BSMdCDAjXKWZ Xi2EmgZBCBWWPddmiKJ7j3r2vPow9VrBrDTv0gYDgCnpfl6B89qupHxfL/T7yXyiZi QqZHipgF/am1rBaXs08Vansc2QPCDiML/9HB31sCkeYvbsSkuCI70FVvaWMTzlC2vy /hfDEFhPtg48f6DEZ/4NDv9dDQTePX4CivTXv7a3aC+HjNMysr/JVg7O4lgFRMaIhb jn57XVwWI9t9/btuwIFSq3MXBEm+qINMl2Sg28cPKBc6Xdmuhk8+KA1L9i893owbSz Dku2codsJR7mQ== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Cc: ChenXiaoSong , Scott Mayhew Subject: [PATCH v2 4/5] NFS: Do not report flush errors in nfs_write_end() Date: Mon, 11 Apr 2022 17:33:45 -0400 Message-Id: <20220411213346.762302-5-trondmy@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220411213346.762302-4-trondmy@kernel.org> References: <20220411213346.762302-1-trondmy@kernel.org> <20220411213346.762302-2-trondmy@kernel.org> <20220411213346.762302-3-trondmy@kernel.org> <20220411213346.762302-4-trondmy@kernel.org> MIME-Version: 1.0 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 8211a7aa799c..16ddb258eef3 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; } From patchwork Mon Apr 11 21:33:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 12809676 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 823E9C433EF for ; Mon, 11 Apr 2022 21:40:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350070AbiDKVm4 (ORCPT ); Mon, 11 Apr 2022 17:42:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350226AbiDKVmz (ORCPT ); Mon, 11 Apr 2022 17:42:55 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60563338AB for ; Mon, 11 Apr 2022 14:40:40 -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 1D958B818C8 for ; Mon, 11 Apr 2022 21:40:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5793DC385A5; Mon, 11 Apr 2022 21:40:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649713237; bh=PILKzRTE62PeTeUucmUsBc8qA03ZD1GzTYPrd7eYXrU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uf5lrpvd3qqafA+rPcR0G1R9A9A5ojV95TAMkwGayhfpeRXeZ3XeFn4mKAe9bJql0 0/LQVAbPPDdIPF3kT4bje013Tyrv+/4NXOXC+c4SVfUq/M2EAFxdYZQOdt6kVcWHth JtIXNL+cEFwhHzvKykiQTCFI1dCo2FktfpHiO5eVrD38FsW9TPMaMdcE/O6u/KPfpH xGOdus9E/gm9DXRcJ4TS0cWH9Fb7HgrnyNlDLvLn7jjRhzi8XcdlCI2HZb38n3Wbz8 +tF4Lu93kNlxloopGOMC9Ar+8nDFrNFEl9x7GdtSC8Ojaqp9voqSWYv36lQUYDqllR hzggL2zaFPVVQ== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Cc: ChenXiaoSong , Scott Mayhew Subject: [PATCH v2 5/5] NFS: Don't report errors from nfs_pageio_complete() more than once Date: Mon, 11 Apr 2022 17:33:46 -0400 Message-Id: <20220411213346.762302-6-trondmy@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220411213346.762302-5-trondmy@kernel.org> References: <20220411213346.762302-1-trondmy@kernel.org> <20220411213346.762302-2-trondmy@kernel.org> <20220411213346.762302-3-trondmy@kernel.org> <20220411213346.762302-4-trondmy@kernel.org> <20220411213346.762302-5-trondmy@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Trond Myklebust Since errors from nfs_pageio_complete() are already being reported through nfs_async_write_error(), we should not be returning them to the callers of do_writepages() as well. They will end up being reported through the generic mechanism instead. Fixes: 6fbda89b257f ("NFS: Replace custom error reporting mechanism with generic one") Signed-off-by: Trond Myklebust --- fs/nfs/write.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 9d3ac6edc901..0fe101e4e3db 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -677,11 +677,7 @@ static int nfs_writepage_locked(struct page *page, err = nfs_do_writepage(page, wbc, &pgio); pgio.pg_error = 0; nfs_pageio_complete(&pgio); - if (err < 0) - return err; - if (nfs_error_is_fatal(pgio.pg_error)) - return pgio.pg_error; - return 0; + return err; } int nfs_writepage(struct page *page, struct writeback_control *wbc) @@ -739,9 +735,6 @@ int nfs_writepages(struct address_space *mapping, struct writeback_control *wbc) if (err < 0) goto out_err; - err = pgio.pg_error; - if (nfs_error_is_fatal(err)) - goto out_err; return 0; out_err: return err;