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>] [day] [month] [year] [list]
Message-Id: <1464631943-37365-1-git-send-email-jhe@cs.wisc.edu>
Date:	Mon, 30 May 2016 13:12:23 -0500
From:	Jun He <jhe@...wisc.edu>
To:	linux-ext4@...r.kernel.org
Cc:	tytso@....edu, Jun He <jhe@...wisc.edu>
Subject: [PATCH] EXT4: Avoid zeroout-ing and writting the same space

When splitting unwritten extent into two extents, currently ext4
zeroout the whole second extent, which contains the requested
space. The requested space will soon be written with data. The
zeroout of requested space is unncessary, causing more traffic
to disk.

Signed-off-by: Jun He <jhe@...wisc.edu>
---
 fs/ext4/extents.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 2a2eef9..2bba31c 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3597,11 +3597,11 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,
 	split_map.m_len = map->m_len;

 	if (max_zeroout && (allocated > map->m_len)) {
-		if (allocated <= max_zeroout) {
+		if (allocated - map->m_len <= max_zeroout) {
 			/* case 3 */
 			zero_ex.ee_block =
-					 cpu_to_le32(map->m_lblk);
-			zero_ex.ee_len = cpu_to_le16(allocated);
+			    cpu_to_le32(map->m_lblk + map->m_len);
+			zero_ex.ee_len = cpu_to_le16(allocated - map->m_len);
 			ext4_ext_store_pblock(&zero_ex,
 				ext4_ext_pblock(ex) + map->m_lblk - ee_block);
 			err = ext4_ext_zeroout(inode, &zero_ex);
--
1.9.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