summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2025-09-05 12:11:17 -0400
committerTrond Myklebust <trond.myklebust@hammerspace.com>2025-09-06 16:51:25 -0400
commitb93128f29733af5d427a335978a19884c2c230e2 (patch)
treeea7d0f9c98253aef28f69fb91f027e84c3777aaf
parent9eb90f435415c7da4800974ed943e39b5578ee7f (diff)
NFSv4.2: Serialise O_DIRECT i/o and fallocate()
Ensure that all O_DIRECT reads and writes complete before calling fallocate so that we don't race w.r.t. attribute updates. Fixes: 99f237832243 ("NFSv4.2: Always flush out writes in nfs42_proc_fallocate()") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
-rw-r--r--fs/nfs/nfs42proc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c
index e2fea37c5348..1a169372ca16 100644
--- a/fs/nfs/nfs42proc.c
+++ b/fs/nfs/nfs42proc.c
@@ -114,6 +114,7 @@ static int nfs42_proc_fallocate(struct rpc_message *msg, struct file *filep,
exception.inode = inode;
exception.state = lock->open_context->state;
+ nfs_file_block_o_direct(NFS_I(inode));
err = nfs_sync_inode(inode);
if (err)
goto out;