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-prev] [day] [month] [year] [list]
Date:	Sat, 19 Apr 2014 11:40:35 +0900
From:	Namjae Jeon <namjae.jeon@...sung.com>
To:	'Theodore Ts'o' <tytso@....edu>
Cc:	'Lukáš Czerner' <lczerner@...hat.com>,
	'Jan Kara' <jack@...e.cz>,
	'linux-ext4' <linux-ext4@...r.kernel.org>
Subject: RE: [PATCH 2/3] ext4: fix ZERO_RANGE test failure in data journalling
 mode

> So a couple of things.  First of all, ext4_force_commit() is a very
> expensive call, so calling it twice is really not a good idea.
Yes, Right.
> 
> Secondly, in the ext4_collapse_range() you are calling
> ext4_force_commit() before filemap_write_and_wait_range().
> 
> 	/* Call ext4_force_commit to flush all data in case of data=journal. */
> 	if (ext4_should_journal_data(inode)) {
> 		ret = ext4_force_commit(inode->i_sb);
> 		if (ret)
> 			return ret;
> 	}
> 
> 	/* Write out all dirty pages */
> 	ret = filemap_write_and_wait_range(inode->i_mapping, offset, -1);
> 	if (ret)
> 		return ret;
> 
> Shouldn't we reverse these two calls?
Yes, The original problem will occur again if we reverse these calls.
ext4_force_commit will mark the buffers as dirty during commit transcation.
So we should sync it using filemap_write_and_wait_range later.
> 
> Finally, I'm wondering if we would be better off creating a new
> explicit EXT4_I(inode)->i_write_mutex which is used to block new
> writes from starting.  This could also be used to subsume the
> ext4_aio_mutex.
Right. It is better method. I will check your point. :)

Thanks Ted!!
> 
> 						- Ted

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