Skip to content

Commit 8b7d9d0

Browse files
committed
NFSv4: Revert "Truncating file opens should also sync O_DIRECT writes"
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 <[email protected]>
1 parent 9a773e7 commit 8b7d9d0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfs/nfs4file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ nfs4_file_open(struct inode *inode, struct file *filp)
6666
if (openflags & O_TRUNC) {
6767
attr.ia_valid |= ATTR_SIZE;
6868
attr.ia_size = 0;
69-
nfs_sync_inode(inode);
69+
filemap_write_and_wait(inode->i_mapping);
7070
}
7171

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

0 commit comments

Comments
 (0)