1 ext4: respect the nobarrier mount option in nojournal mode
3 Also, if we are going to issue the barrier, we should do this after we
4 write out the parent directories if necessary.
6 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
7 Reviewed-by: Jan Kara <jack@suse.cz>
9 fs/ext4/fsync.c | 5 ++++-
10 1 file changed, 4 insertions(+), 1 deletion(-)
12 diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c
13 index 8850254..5c43725 100644
16 @@ -106,9 +106,11 @@ int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
20 - ret = generic_file_fsync(file, start, end, datasync);
21 + ret = __generic_file_fsync(file, start, end, datasync);
22 if (!ret && !hlist_empty(&inode->i_dentry))
23 ret = ext4_sync_parent(inode);
24 + if (test_opt(inode->i_sb, BARRIER))
29 @@ -140,6 +142,7 @@ int ext4_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
31 ret = jbd2_complete_transaction(journal, commit_tid);
34 err = blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL);