]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ocfs2: honor O_(D)SYNC flag in fallocate
authorMark Fasheh <mfasheh@suse.de>
Wed, 16 Nov 2011 20:03:10 +0000 (12:03 -0800)
committerXiaowei.Hu <xiaowei.hu@oracle.com>
Wed, 29 Aug 2012 06:09:12 +0000 (14:09 +0800)
We need to sync the transaction which updates i_size if the file is marked
as needing sync semantics.

Signed-off-by: Mark Fasheh <mfasheh@suse.de>
Signed-off-by: Joel Becker <jlbec@evilplan.org>
(cherry picked from commit df295d4a4b3c98af1a2445a82aef169e7e5d96b8)

Signed-off-by: Xiaowei.Hu <xiaowei.hu@oracle.com>
fs/ocfs2/file.c

index 0f1625bdf313c49701a627186859ed3fe5ce8305..a666d62a537b9b3646023805ca28e61f445d9c61 100644 (file)
@@ -1936,6 +1936,9 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
        if (ret < 0)
                mlog_errno(ret);
 
+       if (file->f_flags & O_SYNC)
+               handle->h_sync = 1;
+
        ocfs2_commit_trans(osb, handle);
 
 out_inode_unlock: