]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Sep 2025 14:35:44 +0000 (16:35 +0200)
[ Upstream commit ca247c89900ae90207f4d321e260cd93b7c7d104 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/nfs42proc.c

index 66fe885fc19a10904aa6ee2162ae9099108a4286..582cf8a469560b1e753def04875f116d7d6741ae 100644 (file)
@@ -356,6 +356,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;