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  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, 24 May 2013 20:09:17 +0530
From:	ashishsangwan2@...il.com
To:	tytso@....edu, adilger@...ger.ca
Cc:	linux-ext4@...r.kernel.org, Ashish Sangwan <a.sangwan@...sung.com>,
	Namjae Jeon <namjae.jeon@...sung.com>
Subject: [PATCH] ext4: optimize extent selection for block removal in case of hole punch

From: Ashish Sangwan <a.sangwan@...sung.com>

Both hole punch and truncate use ext4_ext_rm_leaf for removing
blocks. Currently we choose the last extent as the starting
point for removing blocks: ex = EXT_LAST_EXTENT(eh);
This is OK for truncate but for hole punch we can optimize the
extent selection as the path is already initialized.
We could use this information to select proper starting extent.
The code change in this patch will not affect truncate as for
truncate path[depth].p_ext will always be NULL.

Signed-off-by: Ashish Sangwan <a.sangwan@...sung.com>
Signed-off-by: Namjae Jeon <namjae.jeon@...sung.com>
---
 fs/ext4/extents.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 3676dae..7c1a5d3 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2490,7 +2490,9 @@ ext4_ext_rm_leaf(handle_t *handle, struct inode *inode,
 		return -EIO;
 	}
 	/* find where to start removing */
-	ex = EXT_LAST_EXTENT(eh);
+	ex = path[depth].p_ext;
+	if (!ex)
+		ex = EXT_LAST_EXTENT(eh);
 
 	ex_ee_block = le32_to_cpu(ex->ee_block);
 	ex_ee_len = ext4_ext_get_actual_len(ex);
-- 
1.7.2.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