Commit b93128f2 authored by Trond Myklebust's avatar Trond Myklebust
Browse files

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: 99f23783 ("NFSv4.2: Always flush out writes in nfs42_proc_fallocate()")
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent 9eb90f43
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;