| From fca59e7d66bf36744b66f416123a594162381e16 Mon Sep 17 00:00:00 2001 |
| From: Sasha Levin <sashal@kernel.org> |
| Date: Sat, 6 Sep 2025 10:54:13 -0400 |
| Subject: NFSv4.2: Serialise O_DIRECT i/o and copy range |
| |
| From: Trond Myklebust <trond.myklebust@hammerspace.com> |
| |
| [ 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 | 1 + |
| 1 file changed, 1 insertion(+) |
| |
| diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c |
| index 3774d5b64ba0e..48ee3d5d89c4a 100644 |
| --- a/fs/nfs/nfs42proc.c |
| +++ b/fs/nfs/nfs42proc.c |
| @@ -431,6 +431,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; |
| -- |
| 2.51.0 |
| |