Skip to content

Commit b93128f

Browse files
author
Trond Myklebust
committed
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: 99f2378 ("NFSv4.2: Always flush out writes in nfs42_proc_fallocate()") Signed-off-by: Trond Myklebust <[email protected]>
1 parent 9eb90f4 commit b93128f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/nfs/nfs42proc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ static int nfs42_proc_fallocate(struct rpc_message *msg, struct file *filep,
114114
exception.inode = inode;
115115
exception.state = lock->open_context->state;
116116

117+
nfs_file_block_o_direct(NFS_I(inode));
117118
err = nfs_sync_inode(inode);
118119
if (err)
119120
goto out;

0 commit comments

Comments
 (0)