]> git.baikalelectronics.ru Git - kernel.git/commit
nfs: ensure correct writeback errors are returned on close()
authorScott Mayhew <smayhew@redhat.com>
Sat, 1 Aug 2020 11:10:38 +0000 (07:10 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 1 Aug 2020 19:37:48 +0000 (15:37 -0400)
commit06c5ef6dfdd7599a5c93bbd5284a2d1ba0065be2
tree38c5b336d3c1ccddc3348a030423ab243d580501
parent62ae66d5219c64dc1e4acbae0a21d7d1020ce0d4
nfs: ensure correct writeback errors are returned on close()

nfs_wb_all() calls filemap_write_and_wait(), which uses
filemap_check_errors() to determine the error to return.
filemap_check_errors() only looks at the mapping->flags and will
therefore only return either -ENOSPC or -EIO.  To ensure that the
correct error is returned on close(), nfs{,4}_file_flush() should call
filemap_check_wb_err() which looks at the errseq value in
mapping->wb_err without consuming it.

Fixes: fce4e8f20018 ("NFS: Replace custom error reporting mechanism with
generic one")
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/file.c
fs/nfs/nfs4file.c