summaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust2016-06-25 23:57:39 +0200
committerTrond Myklebust2016-07-06 01:11:08 +0200
commite95fc4a06983c14273a39d26aad9cc5a8a09ff64 (patch)
treeb5a1fa10278be617175f2c8cb99ddf0cad3b85e8 /fs/nfs
parentNFSv4.2: Fix writeback races in nfs4_copy_file_range (diff)
downloadkernel-qcow2-linux-e95fc4a06983c14273a39d26aad9cc5a8a09ff64.tar.gz
kernel-qcow2-linux-e95fc4a06983c14273a39d26aad9cc5a8a09ff64.tar.xz
kernel-qcow2-linux-e95fc4a06983c14273a39d26aad9cc5a8a09ff64.zip
NFSv4.2: llseek(SEEK_HOLE) and llseek(SEEK_DATA) don't require data sync
We want to ensure that we write the cached data to the server, but don't require it be synced to disk. If the server reboots, we will get a stateid error, which will cause us to retry anyway. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/nfs42proc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c
index b7d457cea03f..616dc254b38b 100644
--- a/fs/nfs/nfs42proc.c
+++ b/fs/nfs/nfs42proc.c
@@ -269,7 +269,11 @@ static loff_t _nfs42_proc_llseek(struct file *filep,
if (status)
return status;
- nfs_wb_all(inode);
+ status = nfs_filemap_write_and_wait_range(inode->i_mapping,
+ offset, LLONG_MAX);
+ if (status)
+ return status;
+
status = nfs4_call_sync(server->client, server, &msg,
&args.seq_args, &res.seq_res, 0);
if (status == -ENOTSUPP)