aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2015-10-22 09:02:43 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2015-10-22 09:02:43 +1100
commita2b5390997c2bc2faf795fe8cc9d892dcb090b76 (patch)
treefe8b7a7a322a4324fb02e7d6754547442ca8ae91 /fs
parentd88796b63caa718d5abcdc4f93e30b0f3cf9b414 (diff)
fs/ext4/fsync.c: generic_file_fsync call based on barrier flag
generic_file_fsync has been updated to issue a flush for older filesystems. This patch tests for barrier flag in ext4 mount flags and calls the right function. Lukas said: : Note that the actual generic_file_fsync change fixes a real bug in ext4 : where we would _not_ send a flush on sync if we have file system : without journal. : : Ted, it would be useful to mention that in the commit description : along with the commit id: : : ac13a829f6adb674015ab399594c089990104af7 fs/libfs.c: add generic : data flush to fsync Signed-off-by: Fabian Frederick <fabf@skynet.be> Suggested-by: Jan Kara <jack@suse.cz> Suggested-by: Christoph Hellwig <hch@infradead.org> Reviewed-by: Lukas Czerner <lczerner@redhat.com> Cc: Jan Kara <jack@suse.cz> Cc: Christoph Hellwig <hch@infradead.org> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/fsync.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c
index 8850254136ae..7002467bfbac 100644
--- a/fs/ext4/fsync.c
+++ b/fs/ext4/fsync.c
@@ -106,7 +106,10 @@ int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
}
if (!journal) {
- ret = generic_file_fsync(file, start, end, datasync);
+ if (test_opt(inode->i_sb, BARRIER))
+ ret = generic_file_fsync(file, start, end, datasync);
+ else
+ ret = __generic_file_fsync(file, start, end, datasync);
if (!ret && !hlist_empty(&inode->i_dentry))
ret = ext4_sync_parent(inode);
goto out;