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,  9 Jan 2023 21:05:35 -0700
From:   Andreas Dilger <adilger@...ger.ca>
To:     tytso@....edu
Cc:     linux-ext4@...r.kernel.org, Andreas Dilger <adilger@...ger.ca>
Subject: [PATCH] tests: fix u_direct_io to work with older losetup

Older losetup does not have --sector-size, but this isn't really
needed for the test to work.  Instead specify the filesystem block
size directly to mke2fs, so that it works on all distros instead
of being skipped.

Change-Id: I5a0c82a9efdefd1b48f4d4288998c7725c9ae71e
Signed-off-by: Andreas Dilger <adilger@...ger.ca>
---
 tests/u_direct_io/expect | 2 +-
 tests/u_direct_io/script | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/u_direct_io/expect b/tests/u_direct_io/expect
index 830cbd752652..b1511ef10aa9 100644
--- a/tests/u_direct_io/expect
+++ b/tests/u_direct_io/expect
@@ -1,4 +1,4 @@
-mke2fs -F -o Linux -t ext4 -O ^metadata_csum,^uninit_bg -D $LOOP
+mke2fs -F -b 4096 -o Linux -t ext4 -O ^metadata_csum,^uninit_bg -D $LOOP
 Creating filesystem with 32768 4k blocks and 32768 inodes
 
 Allocating group tables:    ...done                            
diff --git a/tests/u_direct_io/script b/tests/u_direct_io/script
index b4f07752c89f..2f80e640293f 100644
--- a/tests/u_direct_io/script
+++ b/tests/u_direct_io/script
@@ -8,14 +8,14 @@ elif test ! -x $DEBUGFS_EXE; then
     echo "$test_name: $DESCRIPTION: skipped (no debugfs)"
 else
     dd if=/dev/zero of=$TMPFILE bs=1M count=128 > /dev/null 2>&1
-    LOOP=$(losetup --show --sector-size 4096 -f $TMPFILE)
+    LOOP=$(losetup --show -f $TMPFILE 2>&1)
     if [ ! -b "$LOOP" ]; then
         echo "$test_name: $DESCRIPTION: skipped (no loop devices)"
         rm -f $TMPFILE
         exit 0
     fi
-    echo mke2fs -F -o Linux -t ext4 -O ^metadata_csum,^uninit_bg -D \$LOOP > $OUT
-    $MKE2FS -F -o Linux -t ext4 -O ^metadata_csum,^uninit_bg -D $LOOP 2>&1 | \
+    echo mke2fs -F -b 4096 -o Linux -t ext4 -O ^metadata_csum,^uninit_bg -D \$LOOP > $OUT
+    $MKE2FS -F -b 4096 -o Linux -t ext4 -O ^metadata_csum,^uninit_bg -D $LOOP 2>&1 | \
 	sed -f $cmd_dir/filter.sed >> $OUT
 
     echo debugfs -D -R stats \$LOOP >> $OUT
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ