]> git.baikalelectronics.ru Git - kernel.git/commit
NFS: Don't report ENOSPC write errors twice
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 14 May 2022 14:27:02 +0000 (10:27 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Tue, 17 May 2022 16:01:59 +0000 (12:01 -0400)
commit1f24a3c42c87d8463d05c7186692df46c7cfd43a
tree6cdf43e1cfc2637b7e2886cc58606d2545c02e9c
parent9f1e8e066da539ac7d78bc80d71d53e3c4b8072d
NFS: Don't report ENOSPC write errors twice

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 <chenxiaosong2@huawei.com>
Fixes: 4a50b9c69c81 ("nfs: nfs_file_write() should check for writeback errors")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/file.c