Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752667AbaDYWyc (ORCPT ); Fri, 25 Apr 2014 18:54:32 -0400 Received: from mailrelay012.isp.belgacom.be ([195.238.6.179]:41105 "EHLO mailrelay012.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751468AbaDYWyb (ORCPT ); Fri, 25 Apr 2014 18:54:31 -0400 X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtMVAKvmWlNXQASl/2dsb2JhbABZgwarVJlwAgKBEhd0glMTHCMYgQIkE4hFAcpfhVqIG2SEQAEDjnaKDgGKcYdrgzM7gSw Date: Sat, 26 Apr 2014 00:56:31 +0200 From: Fabian Frederick To: linux-kernel Cc: jack , hch , Viro , tytso , akpm Subject: [PATCH V2 2/2] fs/ext4/fsync.c: generic_file_fsync call based on barrier flag Message-Id: <20140426005631.ed2263500401a9076296bccb@skynet.be> X-Mailer: Sylpheed 3.3.0 (GTK+ 2.24.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org generic_file_fsync has been updated to issue a flush for older filesystems. This patch checks barrier flag in ext4 mount flags and calls the right function. Suggested-by: Jan Kara Suggested-by: Christoph Hellwig Cc: Jan Kara Cc: Christoph Hellwig Cc: Alexander Viro Cc: "Theodore Ts'o" Cc: Andrew Morton Signed-off-by: Fabian Frederick --- fs/ext4/fsync.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c index a8bc47f..95bbca0 100644 --- a/fs/ext4/fsync.c +++ b/fs/ext4/fsync.c @@ -107,7 +107,11 @@ 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, + false); if (!ret && !hlist_empty(&inode->i_dentry)) ret = ext4_sync_parent(inode); goto out; -- 1.8.4.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/