Skip to content

Commit c80ebeb

Browse files
author
Trond Myklebust
committed
NFSv4.2: Serialise O_DIRECT i/o and clone range
Ensure that all O_DIRECT reads and writes complete before cloning a file range, so that both the source and destination are up to date. Fixes: a5864c9 ("NFS: Do not serialise O_DIRECT reads and writes") Signed-off-by: Trond Myklebust <[email protected]>
1 parent b93128f commit c80ebeb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/nfs/nfs4file.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,11 @@ static loff_t nfs42_remap_file_range(struct file *src_file, loff_t src_off,
278278
lock_two_nondirectories(src_inode, dst_inode);
279279
/* flush all pending writes on both src and dst so that server
280280
* has the latest data */
281+
nfs_file_block_o_direct(NFS_I(src_inode));
281282
ret = nfs_sync_inode(src_inode);
282283
if (ret)
283284
goto out_unlock;
285+
nfs_file_block_o_direct(NFS_I(dst_inode));
284286
ret = nfs_sync_inode(dst_inode);
285287
if (ret)
286288
goto out_unlock;

0 commit comments

Comments
 (0)