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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210904044946.2102404-2-yangerkun@huawei.com>
Date:   Sat, 4 Sep 2021 12:49:45 +0800
From:   yangerkun <yangerkun@...wei.com>
To:     <tytso@....edu>, <jack@...e.cz>
CC:     <linux-ext4@...r.kernel.org>, <yangerkun@...wei.com>,
        <yukuai3@...wei.com>
Subject: [PATCH 1/2] ext4: avoid recheck extent for EXT4_EX_FORCE_CACHE

Buffer with verified means that it has been checked before. No need
verify and call set_buffer_verified again.

Signed-off-by: yangerkun <yangerkun@...wei.com>
---
 fs/ext4/extents.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index cbf37b2cf871..8559e288472f 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -505,13 +505,16 @@ __read_extent_tree_block(const char *function, unsigned int line,
 		if (err < 0)
 			goto errout;
 	}
-	if (buffer_verified(bh) && !(flags & EXT4_EX_FORCE_CACHE))
-		return bh;
-	err = __ext4_ext_check(function, line, inode,
-			       ext_block_hdr(bh), depth, pblk);
-	if (err)
-		goto errout;
-	set_buffer_verified(bh);
+	if (buffer_verified(bh)) {
+		if (!(flags & EXT4_EX_FORCE_CACHE))
+			return bh;
+	} else {
+		err = __ext4_ext_check(function, line, inode,
+				       ext_block_hdr(bh), depth, pblk);
+		if (err)
+			goto errout;
+		set_buffer_verified(bh);
+	}
 	/*
 	 * If this is a leaf block, cache all of its entries
 	 */
-- 
2.31.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ