Skip to content

Commit

Permalink
NFSv4: Revert "Truncating file opens should also sync O_DIRECT writes"
Browse files Browse the repository at this point in the history
We're not holding any locks, so both nfs_wb_all() and inode_dio_wait()
are unenforcible and have livelock potential. Just limit ourselves to
flushing out the data.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
  • Loading branch information
Trond Myklebust committed Jul 14, 2016
1 parent 9a773e7 commit 8b7d9d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfs/nfs4file.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ nfs4_file_open(struct inode *inode, struct file *filp)
if (openflags & O_TRUNC) {
attr.ia_valid |= ATTR_SIZE;
attr.ia_size = 0;
nfs_sync_inode(inode);
filemap_write_and_wait(inode->i_mapping);
}

inode = NFS_PROTO(dir)->open_context(dir, ctx, openflags, &attr, NULL);
Expand Down

0 comments on commit 8b7d9d0

Please sign in to comment.