提交 1b33809e 编写于 作者: C Christoph Hellwig 提交者: Trond Myklebust

nfs: commit layouts in fdatasync

 "fdatasync() is similar to fsync(), but does not flush modified metadata
  unless that metadata is needed in order  to  allow  a  subsequent  data
  retrieval to be correctly handled."

We absolutely need to commit the layouts to be able to retrieve the data
in case either the client, the server or the storage subsystem go down.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
上级 7a9a7b77
...@@ -100,8 +100,7 @@ nfs4_file_fsync(struct file *file, loff_t start, loff_t end, int datasync) ...@@ -100,8 +100,7 @@ nfs4_file_fsync(struct file *file, loff_t start, loff_t end, int datasync)
break; break;
mutex_lock(&inode->i_mutex); mutex_lock(&inode->i_mutex);
ret = nfs_file_fsync_commit(file, start, end, datasync); ret = nfs_file_fsync_commit(file, start, end, datasync);
if (!ret && !datasync) if (!ret)
/* application has asked for meta-data sync */
ret = pnfs_layoutcommit_inode(inode, true); ret = pnfs_layoutcommit_inode(inode, true);
mutex_unlock(&inode->i_mutex); mutex_unlock(&inode->i_mutex);
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册