[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20220623015858.1728497-1-chenxiaosong2@huawei.com>
Date: Thu, 23 Jun 2022 09:58:58 +0800
From: ChenXiaoSong <chenxiaosong2@...wei.com>
To: <trond.myklebust@...merspace.com>, <anna@...nel.org>
CC: <linux-nfs@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<chenxiaosong2@...wei.com>, <liuyongqiang13@...wei.com>,
<yi.zhang@...wei.com>, <zhangxiaoxu5@...wei.com>
Subject: [PATCH] NFS: remove redundant code in nfs_file_write()
filemap_fdatawait_range() will always return 0, after patch 6c984083ec24
("NFS: Use of mapping_set_error() results in spurious errors"), it will not
save the wb err in struct address_space->flags:
result = filemap_fdatawait_range(file->f_mapping, ...) = 0
filemap_check_errors(mapping) = 0
test_bit(..., &mapping->flags) // flags is 0
Signed-off-by: ChenXiaoSong <chenxiaosong2@...wei.com>
---
fs/nfs/file.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 2d72b1b7ed74..54237a231687 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -663,8 +663,6 @@ ssize_t nfs_file_write(struct kiocb *iocb, struct iov_iter *from)
result = filemap_fdatawait_range(file->f_mapping,
iocb->ki_pos - written,
iocb->ki_pos - 1);
- if (result < 0)
- goto out;
}
result = generic_write_sync(iocb, written);
if (result < 0)
--
2.31.1
Powered by blists - more mailing lists