summaryrefslogtreecommitdiffstats
path: root/fs/nfs/internal.h
diff options
context:
space:
mode:
authorTrond Myklebust2016-06-26 00:12:03 +0200
committerTrond Myklebust2016-07-06 01:11:07 +0200
commit837bb1d752d92ea4d870877ffbd6ec5cf76624b3 (patch)
treebc6efb2d8fff743b5dd56ed0848fa9f4f99c2e3c /fs/nfs/internal.h
parentNFSv4.2: Fix a race in nfs42_proc_deallocate() (diff)
downloadkernel-qcow2-linux-837bb1d752d92ea4d870877ffbd6ec5cf76624b3.tar.gz
kernel-qcow2-linux-837bb1d752d92ea4d870877ffbd6ec5cf76624b3.tar.xz
kernel-qcow2-linux-837bb1d752d92ea4d870877ffbd6ec5cf76624b3.zip
NFSv4.2: Fix writeback races in nfs4_copy_file_range
We need to ensure that any writes to the destination file are serialised with the copy, meaning that the writeback has to occur under the inode lock. Also relax the writeback requirement on the source, and rely on the stateid checking to tell us if the source rebooted. Add the helper nfs_filemap_write_and_wait_range() to call pnfs_sync_inode() as is appropriate for pNFS servers that may need a layoutcommit. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/internal.h')
-rw-r--r--fs/nfs/internal.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index 01dccf18da0a..3b01c9146e15 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -512,6 +512,9 @@ int nfs_key_timeout_notify(struct file *filp, struct inode *inode);
bool nfs_ctx_key_to_expire(struct nfs_open_context *ctx);
void nfs_pageio_stop_mirroring(struct nfs_pageio_descriptor *pgio);
+int nfs_filemap_write_and_wait_range(struct address_space *mapping,
+ loff_t lstart, loff_t lend);
+
#ifdef CONFIG_NFS_V4_1
static inline
void nfs_clear_pnfs_ds_commit_verifiers(struct pnfs_ds_commit_info *cinfo)