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]
Message-Id: <1364807037-21664-1-git-send-email-dmonakhov@openvz.org>
Date:	Mon,  1 Apr 2013 13:03:56 +0400
From:	Dmitry Monakhov <dmonakhov@...nvz.org>
To:	linux-ext4@...r.kernel.org
Cc:	tytso@....edu, jack@...e.cz, Dmitry Monakhov <dmonakhov@...nvz.org>
Subject: [PATCH 1/2] ext3: optimize ext3_force_commit

We do not have to use journal_force_commit() because it explicitly
start and stop SYNC transaction. This is very suboptimal because the only
users of ext3_force_commit() are ext3_sync_file and ext3_write_inode().
Both functions just want to commit and wait any uncommitted transaction
similar to ext3_sync_fs().

Signed-off-by: Dmitry Monakhov <dmonakhov@...nvz.org>
---
 fs/ext3/super.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index fb5120a..1853031 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -2507,15 +2507,14 @@ static void ext3_clear_journal_err(struct super_block *sb,
  */
 int ext3_force_commit(struct super_block *sb)
 {
-	journal_t *journal;
-	int ret;
+	tid_t target;
 
 	if (sb->s_flags & MS_RDONLY)
 		return 0;
 
-	journal = EXT3_SB(sb)->s_journal;
-	ret = ext3_journal_force_commit(journal);
-	return ret;
+	if (journal_start_commit(EXT3_SB(sb)->s_journal, &target))
+		return log_wait_commit(EXT3_SB(sb)->s_journal, target);
+	return 0;
 }
 
 static int ext3_sync_fs(struct super_block *sb, int wait)
@@ -2530,7 +2529,7 @@ static int ext3_sync_fs(struct super_block *sb, int wait)
 	dquot_writeback_dquots(sb, -1);
 	if (journal_start_commit(EXT3_SB(sb)->s_journal, &target)) {
 		if (wait)
-			log_wait_commit(EXT3_SB(sb)->s_journal, target);
+			return log_wait_commit(EXT3_SB(sb)->s_journal, target);
 	}
 	return 0;
 }
-- 
1.7.1

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ