From patchwork Sat May 14 14:27:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 12849824 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 A0285C433EF for ; Sat, 14 May 2022 14:33:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233345AbiENOdR (ORCPT ); Sat, 14 May 2022 10:33:17 -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 S233335AbiENOdQ (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 4C7FC1C134 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 CAA49B808BC for ; Sat, 14 May 2022 14:33:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31860C34115; Sat, 14 May 2022 14:33:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652538791; bh=sWSQWQV6+C6Wk5/V/IJldIJ/fI3yA92GS7TVuJK9QJo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wclx6NRkeywopOtiNTWr1ydnkjKoh/r5ZVZEd5DucY8bvpwHjln7JTgYSWGISPEO1 HM0nJv0K6dJSTMwj6ELl7I7FVwgmkpa7NX0V9wmuisegFTgF5TfTXlv9R6BPpkzWdq iQISpJPmATFiG175+4uAqK91dcPO9kyDO25JVsiNPSGLWYE16LItYP1jrPyI9yyZ6X Cq2BcV4/xW3LEG5ITEBmwv8PAYyLebmMdxZu6Qsj0Uqi3nFfcwkeh04qObtj6V0gT8 Ll3oIF7yBOU5l4oWS3lLgB0IO8hFVBtnIzTHZdqLfq/1QYhN38HYyTg5U5IrzGCBcH hUGlXnc8x8xRw== From: trondmy@kernel.org To: Anna Schumaker Cc: linux-nfs@vger.kernel.org Subject: [PATCH v3 1/5] NFS: Do not report EINTR/ERESTARTSYS as mapping errors Date: Sat, 14 May 2022 10:27:00 -0400 Message-Id: <20220514142704.4149-2-trondmy@kernel.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220514142704.4149-1-trondmy@kernel.org> References: <20220514142704.4149-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 a8eb348947a6..ce4cc4222422 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -1441,7 +1441,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 Sat May 14 14:27:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 12849825 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 BF00EC433F5 for ; Sat, 14 May 2022 14:33:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233335AbiENOdR (ORCPT ); Sat, 14 May 2022 10:33:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233333AbiENOdQ (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 A1D861C91A 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 5D971B808D4 for ; Sat, 14 May 2022 14:33:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC8E0C340EE; Sat, 14 May 2022 14:33:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652538792; bh=TnkYOxtcX0bijf8kIP+vmw0tFtDlR1x+1BxPHrsP0j8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jBkA6nPhVjwesla2NEbqgmzmcgK0jIn445dnxVDyHpBSUWZAE7wcNutKWKp0Xg7qr 3J0D6Fd4R9Cb5noCoTLqtiu8Hr7VOd5tkhDb9ivAVL/Z9YF+dmMZsoTZtdFEyx0QZB wbr56vuthWblLak3px2Au2bmPZ7HVtdSPcF2At9iEkMiIYkupIzj1qKjSUoUw5oSLm lb7EyAybxIx73qrI2DOYIwyKTCSIl7bkqa2MuMvoZnbWH/msKIhZRCIrm9gwiP3Vdk JuDjdwy4276vxi0hlR95ksUyHNaIj5LmrkF0lqs6zmX/6+CiA/l0I+4MbSTNriskwA dcgH6y/TfzQcw== From: trondmy@kernel.org To: Anna Schumaker Cc: linux-nfs@vger.kernel.org Subject: [PATCH v3 2/5] NFS: fsync() should report filesystem errors over EINTR/ERESTARTSYS Date: Sat, 14 May 2022 10:27:01 -0400 Message-Id: <20220514142704.4149-3-trondmy@kernel.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220514142704.4149-2-trondmy@kernel.org> References: <20220514142704.4149-1-trondmy@kernel.org> <20220514142704.4149-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 150b7fa8f0a7..7c380e555224 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 Sat May 14 14:27:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 12849828 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 40C43C4332F for ; Sat, 14 May 2022 14:33:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233333AbiENOdS (ORCPT ); Sat, 14 May 2022 10:33:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233336AbiENOdQ (ORCPT ); Sat, 14 May 2022 10:33:16 -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 CBD471CFC9 for ; Sat, 14 May 2022 07:33:15 -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 E722CB808D2 for ; Sat, 14 May 2022 14:33:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 542B0C34116; 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=1652538792; bh=zKmbQrO0dGT4kPWfRXQOJRxWwZShgqPqnlD75es0YCc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dNzMKTQx/H12/GR9GxPLyhUE3RvCWSS1YlF8RapFKERb1QiZe6yat8kb7QXo6tHnK IblqGPl56vN+QW+mDxbE25jveDYoCTwd4r9D9uW8gG6vb86pV9SoAPRoTkOcwoG0fj I7fbEljt6pu2yYFjQe/YIMKbqgGWtHPJcsHQupP9nhgBdPFy0imuqh27Rp6zQjqOp4 f6K7ukhwI6eCfxBLhPdGzo73Q0xhZvoxIMe24agcEWz1QnIz0vlrDpLH4Ze4fPCui1 afgTzFmAVTWRRURJNyvFEhkVk0sB/KNEp2lekgM/kG7Q3rSbJkWG33vFiy9GdFGGXF 1DR2hB678GENw== From: trondmy@kernel.org To: Anna Schumaker Cc: linux-nfs@vger.kernel.org Subject: [PATCH v3 3/5] NFS: Don't report ENOSPC write errors twice Date: Sat, 14 May 2022 10:27:02 -0400 Message-Id: <20220514142704.4149-4-trondmy@kernel.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220514142704.4149-3-trondmy@kernel.org> References: <20220514142704.4149-1-trondmy@kernel.org> <20220514142704.4149-2-trondmy@kernel.org> <20220514142704.4149-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 | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 7c380e555224..87e4cd5e8fe2 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); @@ -656,6 +644,7 @@ ssize_t nfs_file_write(struct kiocb *iocb, struct iov_iter *from) written = result; iocb->ki_pos += written; + nfs_add_stats(inode, NFSIOS_NORMALWRITTENBYTES, written); if (mntflags & NFS_MOUNT_WRITE_EAGER) { result = filemap_fdatawrite_range(file->f_mapping, @@ -673,17 +662,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 Sat May 14 14:27:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 12849827 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 A6D20C433FE for ; Sat, 14 May 2022 14:33:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233336AbiENOdS (ORCPT ); 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 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; } From patchwork Sat May 14 14:27:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 12849826 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 1FC65C43217 for ; Sat, 14 May 2022 14:33:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232498AbiENOdT (ORCPT ); Sat, 14 May 2022 10:33:19 -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 S233339AbiENOdQ (ORCPT ); Sat, 14 May 2022 10:33:16 -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 CBE371CFCB for ; Sat, 14 May 2022 07:33:15 -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 17EEFB80907 for ; Sat, 14 May 2022 14:33:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 712D2C34115; Sat, 14 May 2022 14:33:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652538793; bh=2uypRLy68/oN/fKavebGwOtAoHFFpgu9SH9UJYQ3NR8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Njjq1zSbS3PwpRFT1MNAHT90BB7ps+4HLakzK1dF1hefyb9YE9FH6PgyQHe6XjqwX /TsdoZSBrfzgHZm5kLFF9DkJS7frP4Al6Rh1z3n0bwsxtNB44OwkKxhqQ399cU4ySp yFASVeeN/tSeB4ukCe6hF8/mPDPXAjqNS/YUQ47lb7aouzuXifgBLrxHj5qqId5PF4 gjDV3ZPpjG1rT5xRxHax1+bmEO+Dn4Fbnr98GlTkTRpYICe/SLOdjyqhh2HPTJ7BSu BYrrGjtbRcAJ0efOKSZdKJrpmv3ulHF9uMu9S+p8MBWWqdKj6mkoLJ9jh/HOWphztz e8jRoR9ugiIbQ== From: trondmy@kernel.org To: Anna Schumaker Cc: linux-nfs@vger.kernel.org Subject: [PATCH v3 5/5] NFS: Don't report errors from nfs_pageio_complete() more than once Date: Sat, 14 May 2022 10:27:04 -0400 Message-Id: <20220514142704.4149-6-trondmy@kernel.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220514142704.4149-5-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> <20220514142704.4149-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 ce4cc4222422..2f41659e232e 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -675,11 +675,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) @@ -744,9 +740,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;