From b4919d23a9377adb590e8078c146c5f4e5af6052 Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Fri, 11 Jul 2008 19:27:31 -0400 Subject: [PATCH] --- yaml --- r: 101098 b: refs/heads/master c: d755fb384250d6bd7fd18a0930e71965acc8e72e h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/ext4/fsync.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 0bc318823f0a..b501be97119f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 654b4908bc17a6318d18f3036fecc5155de92f55 +refs/heads/master: d755fb384250d6bd7fd18a0930e71965acc8e72e diff --git a/trunk/fs/ext4/fsync.c b/trunk/fs/ext4/fsync.c index 1c8ba48d4f8d..a45c3737ad31 100644 --- a/trunk/fs/ext4/fsync.c +++ b/trunk/fs/ext4/fsync.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "ext4.h" #include "ext4_jbd2.h" @@ -45,6 +46,7 @@ int ext4_sync_file(struct file * file, struct dentry *dentry, int datasync) { struct inode *inode = dentry->d_inode; + journal_t *journal = EXT4_SB(inode->i_sb)->s_journal; int ret = 0; J_ASSERT(ext4_journal_current_handle() == NULL); @@ -85,6 +87,8 @@ int ext4_sync_file(struct file * file, struct dentry *dentry, int datasync) .nr_to_write = 0, /* sys_fsync did this */ }; ret = sync_inode(inode, &wbc); + if (journal && (journal->j_flags & JBD2_BARRIER)) + blkdev_issue_flush(inode->i_sb->s_bdev, NULL); } out: return ret;