From: Chris Mason Date: Fri, 29 Sep 2006 08:59:54 +0000 (-0700) Subject: [PATCH] reiserfs_fsync should only use barriers when they are enabled X-Git-Tag: firefly_0821_release~33152 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=25736b1c692d436508585d1d710912e6f76be2d8;p=firefly-linux-kernel-4.4.55.git [PATCH] reiserfs_fsync should only use barriers when they are enabled make sure that reiserfs_fsync only triggers barriers when mounted with -o barrier=flush Signed-off-by: Chris Mason Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c index 1627edd50810..1cfbe857ba27 100644 --- a/fs/reiserfs/file.c +++ b/fs/reiserfs/file.c @@ -130,7 +130,7 @@ static int reiserfs_sync_file(struct file *p_s_filp, reiserfs_write_lock(p_s_inode->i_sb); barrier_done = reiserfs_commit_for_inode(p_s_inode); reiserfs_write_unlock(p_s_inode->i_sb); - if (barrier_done != 1) + if (barrier_done != 1 && reiserfs_barrier_flush(p_s_inode->i_sb)) blkdev_issue_flush(p_s_inode->i_sb->s_bdev, NULL); if (barrier_done < 0) return barrier_done;