summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4file.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2014-04-21 13:29:17 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2014-05-28 17:45:30 -0400
commit1b33809ea8c671ccbceeaaa8d842631b441bed54 (patch)
tree534b6e6b3ffcc3cf2df17b3cf184fb92269b233b /fs/nfs/nfs4file.c
parent7a9a7b774fd543467313894fe53bc7dcc47d5708 (diff)
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: Christoph Hellwig <hch@lst.de> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/nfs4file.c')
-rw-r--r--fs/nfs/nfs4file.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c
index 8de3407e0360..464db9dd6318 100644
--- a/fs/nfs/nfs4file.c
+++ b/fs/nfs/nfs4file.c
@@ -100,8 +100,7 @@ nfs4_file_fsync(struct file *file, loff_t start, loff_t end, int datasync)
100 break; 100 break;
101 mutex_lock(&inode->i_mutex); 101 mutex_lock(&inode->i_mutex);
102 ret = nfs_file_fsync_commit(file, start, end, datasync); 102 ret = nfs_file_fsync_commit(file, start, end, datasync);
103 if (!ret && !datasync) 103 if (!ret)
104 /* application has asked for meta-data sync */
105 ret = pnfs_layoutcommit_inode(inode, true); 104 ret = pnfs_layoutcommit_inode(inode, true);
106 mutex_unlock(&inode->i_mutex); 105 mutex_unlock(&inode->i_mutex);
107 /* 106 /*