Commit 8d97deb9 authored by Bobi Jam's avatar Bobi Jam Committed by Greg Kroah-Hartman

staging/lustre/llite: issue OST_SYNC for fsync()

The last parameter @datasync of fsync() has following indication:
* if datasync=0, we'd always flush data and metadata
* if datasync=1, we'd always flush data while does not flush modifed
  metadata unless that metadata is needed in order to allow a
  subsequent data retrieval to be correctly handled. For example, a
  change to the file size would require a metadata flush.

Lustre client can not tell the difference easily, and would issue
MDS_SYNC and OST_SYNC in all cases.
Signed-off-by: default avatarBobi Jam <bobijam.xu@intel.com>
Reviewed-on: http://review.whamcloud.com/8684
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4388Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Reviewed-by: default avatarJinshan Xiong <jinshan.xiong@intel.com>
Signed-off-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0667dfff
...@@ -2653,7 +2653,7 @@ int ll_fsync(struct file *file, loff_t start, loff_t end, int datasync) ...@@ -2653,7 +2653,7 @@ int ll_fsync(struct file *file, loff_t start, loff_t end, int datasync)
if (!err) if (!err)
ptlrpc_req_finished(req); ptlrpc_req_finished(req);
if (datasync && S_ISREG(inode->i_mode)) { if (S_ISREG(inode->i_mode)) {
struct ll_file_data *fd = LUSTRE_FPRIVATE(file); struct ll_file_data *fd = LUSTRE_FPRIVATE(file);
err = cl_sync_file_range(inode, 0, OBD_OBJECT_EOF, err = cl_sync_file_range(inode, 0, OBD_OBJECT_EOF,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment