lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 26 Mar 2010 18:21:02 +0200
From:	Surbhi Palande <surbhi.palande@...onical.com>
To:	linux-ext4@...r.kernel.org
Cc:	Theodore Tso <tytso@....edu>
Subject: [PATCH] ext4: Ensure writecache to disk in no journal mode

Ensure that in the no journal mode the write cache is flushed to the disk by
calling a blkdev_issue_flush() which issues a WRITE_BARRIER if necessary.

Signed-off-by: Surbhi Palande <surbhi.palande@...onical.com>
---
 fs/ext4/fsync.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c
index d6049e4..1d73a50 100644
--- a/fs/ext4/fsync.c
+++ b/fs/ext4/fsync.c
@@ -67,8 +67,12 @@ int ext4_sync_file(struct file *file, struct dentry *dentry, int datasync)
 	if (ret < 0)
 		return ret;
 
-	if (!journal)
-		return simple_fsync(file, dentry, datasync);
+	if (!journal) {
+		ret = simple_fsync(file, dentry, datasync);
+		if (test_opt(inode->i_sb, BARRIER))
+			blkdev_issue_flush(inode->i_sb->s_bdev, NULL);
+		return ret;
+	}
 
 	/*
 	 * data=writeback,ordered:
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists