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]
Date:   Mon, 14 Mar 2022 16:02:07 +0530
From:   Ojaswin Mujoo <ojaswin@...ux.ibm.com>
To:     fstests@...r.kernel.org
Cc:     riteshh@...ux.ibm.com, linux-ext4@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH] ext4/053: Add support for testing mb_optimize_scan

Add support to test the mb_optimize_scan mount option.
Since its value is not reflected in the "options" file in proc,
use "mb_structs_summary" to verify its value.

Signed-off-by: Ojaswin Mujoo <ojaswin@...ux.ibm.com>
---
 tests/ext4/053 | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/tests/ext4/053 b/tests/ext4/053
index e1e79592..bd92002f 100755
--- a/tests/ext4/053
+++ b/tests/ext4/053
@@ -100,6 +100,7 @@ test_mnt() {
 	(
 	ret=0
 	IFS=','
+	proc_path="/proc/fs/ext4/$(_short_dev $SCRATCH_DEV)"
 	for option in $OPTS; do
 		if echo $IGNORED | grep -w $option; then
 			continue
@@ -114,11 +115,16 @@ test_mnt() {
 		fi
 		option=${option#^}
 
-		if echo $CHECK_MINFO | grep -w $option; then
+		if [[ $option =~ ^mb_optimize_scan=.*$ ]]; then
+			# mb_optimize_scan needs special handling
+			expected=${option#*=}
+			ret=$(cat $proc_path/mb_structs_summary | grep "optimize_scan" \
+				| awk '{ print $2 }')
+		elif echo $CHECK_MINFO | grep -w $option; then
 			findmnt -n -o OPTIONS $SCRATCH_DEV | grep $option
 			ret=$?
 		else
-			grep $option /proc/fs/ext4/$(_short_dev $SCRATCH_DEV)/options
+			grep $option $proc_path/options
 			ret=$?
 		fi
 
@@ -526,13 +532,10 @@ for fstype in ext2 ext3 ext4; do
 
 	mnt prefetch_block_bitmaps removed
 	mnt no_prefetch_block_bitmaps
-	# We don't currently have a way to know that the option has been
-	# applied, so comment it out for now. This should be fixed in the
-	# future.
-	#mnt mb_optimize_scan=0
-	#mnt mb_optimize_scan=1
-	#not_mnt mb_optimize_scan=9
-	#not_mnt mb_optimize_scan=
+	mnt mb_optimize_scan=0
+	mnt mb_optimize_scan=1
+	not_mnt mb_optimize_scan=9
+	not_mnt mb_optimize_scan=
 	mnt nombcache
 	mnt no_mbcache nombcache
 	mnt check=none removed
-- 
2.27.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ