]> git.karo-electronics.de Git - linux-beck.git/commitdiff
NFSv4.2: llseek(SEEK_HOLE) and llseek(SEEK_DATA) don't require data sync
authorTrond Myklebust <trond.myklebust@primarydata.com>
Sat, 25 Jun 2016 21:57:39 +0000 (17:57 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Tue, 5 Jul 2016 23:11:08 +0000 (19:11 -0400)
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>
fs/nfs/nfs42proc.c

index b7d457cea03f01b17b09a2ebb1bdbcdb1f5d2212..616dc254b38bd25038a46e47ca7ff73035400c8c 100644 (file)
@@ -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)