NFSv4.2: Serialise O_DIRECT i/o and copy range
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 6 Sep 2025 14:54:13 +0000 (10:54 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 6 Sep 2025 20:51:25 +0000 (16:51 -0400)
Ensure that all O_DIRECT reads and writes complete before copying a file
range, so that the destination is up to date.

Fixes: a5864c999de6 ("NFS: Do not serialise O_DIRECT reads and writes")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/nfs42proc.c

index 1a169372ca16e1ba49b77a738d4a169d959bb6e0..6a0b5871ba3b090d7a1fc71d305dcb555435e72c 100644 (file)
@@ -445,6 +445,7 @@ static ssize_t _nfs42_proc_copy(struct file *src,
                return status;
        }
 
+       nfs_file_block_o_direct(NFS_I(dst_inode));
        status = nfs_sync_inode(dst_inode);
        if (status)
                return status;