diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2016-06-25 18:12:03 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2016-07-05 19:11:07 -0400 |
commit | 837bb1d752d92ea4d870877ffbd6ec5cf76624b3 (patch) | |
tree | bc6efb2d8fff743b5dd56ed0848fa9f4f99c2e3c /fs/nfs/internal.h | |
parent | 1e564d3dbd684a105582471cb9ff2aada64a9052 (diff) | |
download | linux-rpi-837bb1d752d92ea4d870877ffbd6ec5cf76624b3.tar.gz linux-rpi-837bb1d752d92ea4d870877ffbd6ec5cf76624b3.tar.bz2 linux-rpi-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.h | 3 |
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) |