summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4file.c
diff options
context:
space:
mode:
authorTrond Myklebust <trondmy@gmail.com>2019-04-07 19:59:04 +0200
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2019-04-25 20:18:14 +0200
commitaded8d7b54f250af6deb72fde475291cfba513d1 (patch)
treeb1836af68dccf3bc8a4c7163c5503388b260666d /fs/nfs/nfs4file.c
parentNFS: Don't call generic_error_remove_page() while holding locks (diff)
downloadlinux-aded8d7b54f250af6deb72fde475291cfba513d1.tar.xz
linux-aded8d7b54f250af6deb72fde475291cfba513d1.zip
NFS: Don't inadvertently clear writeback errors
vfs_fsync() has the side effect of clearing unreported writeback errors, so we need to make sure that we do not abuse it in situations where applications might not normally expect us to report those errors. The solution is to replace calls to vfs_fsync() with calls to nfs_wb_all(). Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to '')
-rw-r--r--fs/nfs/nfs4file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c
index 00d17198ee12..d2846f164997 100644
--- a/fs/nfs/nfs4file.c
+++ b/fs/nfs/nfs4file.c
@@ -125,7 +125,7 @@ nfs4_file_flush(struct file *file, fl_owner_t id)
return filemap_fdatawrite(file->f_mapping);
/* Flush writes to the server and return any errors */
- return vfs_fsync(file, 0);
+ return nfs_wb_all(inode);
}
#ifdef CONFIG_NFS_V4_2