Skip to content

Commit 4089fd7

Browse files
Trond Myklebustgregkh
authored andcommitted
NFSv4.2: Serialise O_DIRECT i/o and fallocate()
[ Upstream commit b93128f ] 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 <trond.myklebust@hammerspace.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 320a095 commit 4089fd7

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
@@ -112,6 +112,7 @@ static int nfs42_proc_fallocate(struct rpc_message *msg, struct file *filep,
112112
exception.inode = inode;
113113
exception.state = lock->open_context->state;
114114

115+
nfs_file_block_o_direct(NFS_I(inode));
115116
err = nfs_sync_inode(inode);
116117
if (err)
117118
goto out;

0 commit comments

Comments
 (0)