Skip to contentSkip to conversation

xfs/513: fix 4k allocsize fails on 64k pagesize

PATCH In review Zorro Lang 2 participants 4 messages Feb 18, 2020 – Feb 24, 2020

lore
Share & tools
lore

Zorro Lang

author
#0 lore raw

PATCH 1/1 xfs/513: fix 4k allocsize fails on 64k pagesize

The minimal I/O preallocation size is page size. The allocsize=4k always fails on 64k pagesize machine. So change the fs blocksize allocsize test to allocsize=64k.

---
 tests/xfs/513     | 4 ++--
 tests/xfs/513.out | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
tests/xfs/513 +2 -2
index 70bc2f1c..3c3f5163 100755
@@ -178,13 +178,13 @@ do_test()
 
 echo "** start xfs mount testing ..."
 # Test allocsize=size
-# Valid values for this option are page size (typically 4KiB) through to 1GiB
+# Valid values for this option are page size through to 1GiB
 do_mkfs
 if [ $dbsize -ge 1024 ];then
 	blsize="$((dbsize / 1024))k"
 fi
 do_test "" pass "allocsize" "false"
-do_test "-o allocsize=$blsize" pass "allocsize=$blsize" "true"
+do_test "-o allocsize=64k" pass "allocsize=64k" "true"
 do_test "-o allocsize=1048576k" pass "allocsize=1048576k" "true"
 do_test "-o allocsize=$((dbsize / 2))" fail
 do_test "-o allocsize=2g" fail
tests/xfs/513.out +1 -1
index 9be18dd8..2d9f8384 100644
@@ -5,7 +5,7 @@ QA output created by 513
 ** start xfs mount testing ...
 FORMAT: 
 TEST: "" "pass" "allocsize" "false"
-TEST: "-o allocsize=4k" "pass" "allocsize=4k" "true"
+TEST: "-o allocsize=64k" "pass" "allocsize=64k" "true"
 TEST: "-o allocsize=1048576k" "pass" "allocsize=1048576k" "true"
 TEST: "-o allocsize=2048" "fail"
 TEST: "-o allocsize=2g" "fail"
Signature · 1 line
2.20.1
#1 lore raw
Quoted 5 lines · Zorro Lang

The minimal I/O preallocation size is page size. The allocsize=4k always fails on 64k pagesize machine. So change the fs blocksize allocsize test to allocsize=64k.

I think it's better to make the page size auto-detected, and filter out the actual size to something like "PAGESIZE" in .out file.

Quoted 12 lines
---
 tests/xfs/513     | 4 ++--
 tests/xfs/513.out | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
tests/xfs/513 +0 -0
index 70bc2f1c..3c3f5163 100755
@@ -178,13 +178,13 @@ do_test()
 
 echo "** start xfs mount testing ..."

tests/xfs/513 do_test() · line 187

Quoted 10 lines
tests/xfs/513 +2 -2
 # Test allocsize=size
-# Valid values for this option are page size (typically 4KiB) through to 1GiB
+# Valid values for this option are page size through to 1GiB
 do_mkfs
 if [ $dbsize -ge 1024 ];then
 	blsize="$((dbsize / 1024))k"
 fi
 do_test "" pass "allocsize" "false"
-do_test "-o allocsize=$blsize" pass "allocsize=$blsize" "true"
+do_test "-o allocsize=64k" pass "allocsize=64k" "true"

do_test "-o allocsize=PAGESIZE" pass "allocsize=PAGESIZE" "true"

And do_test converts the "PAGESIZE" to actual page size.

tests/xfs/513.out QA output created by 513 · line 8

Quoted 13 lines
tests/xfs/513 +0 -0
 do_test "-o allocsize=1048576k" pass "allocsize=1048576k" "true"
 do_test "-o allocsize=$((dbsize / 2))" fail
 do_test "-o allocsize=2g" fail
tests/xfs/513.out +1 -1
index 9be18dd8..2d9f8384 100644
@@ -5,7 +5,7 @@ QA output created by 513
 ** start xfs mount testing ...
 FORMAT: 
 TEST: "" "pass" "allocsize" "false"
-TEST: "-o allocsize=4k" "pass" "allocsize=4k" "true"
+TEST: "-o allocsize=64k" "pass" "allocsize=64k" "true"

So .out prints "... allocsize=PAGESIZE" ...

Thanks,
Eryu

Quoted 6 lines
tests/xfs/513.out +0 -0
 TEST: "-o allocsize=1048576k" "pass" "allocsize=1048576k" "true"
 TEST: "-o allocsize=2048" "fail"
 TEST: "-o allocsize=2g" "fail"
Signature · 1 line
2.20.1
author
#2 lore raw
Quoted 35 lines · Eryu Guan
Quoted 5 lines · Zorro Lang

The minimal I/O preallocation size is page size. The allocsize=4k always fails on 64k pagesize machine. So change the fs blocksize allocsize test to allocsize=64k.

I think it's better to make the page size auto-detected, and filter out the actual size to something like "PAGESIZE" in .out file.

Quoted 12 lines
---
 tests/xfs/513     | 4 ++--
 tests/xfs/513.out | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
tests/xfs/513 +0 -0
index 70bc2f1c..3c3f5163 100755
@@ -178,13 +178,13 @@ do_test()
 
 echo "** start xfs mount testing ..."

tests/xfs/513 do_test() · line 187

Quoted 10 lines
tests/xfs/513 +2 -2
 # Test allocsize=size
-# Valid values for this option are page size (typically 4KiB) through to 1GiB
+# Valid values for this option are page size through to 1GiB
 do_mkfs
 if [ $dbsize -ge 1024 ];then
 	blsize="$((dbsize / 1024))k"
 fi
 do_test "" pass "allocsize" "false"
-do_test "-o allocsize=$blsize" pass "allocsize=$blsize" "true"
+do_test "-o allocsize=64k" pass "allocsize=64k" "true"

do_test "-o allocsize=PAGESIZE" pass "allocsize=PAGESIZE" "true"

Quoted 1 line

And do_test converts the "PAGESIZE" to actual page size.

I thought about that too, but due to this case only uses PAGESIZE once at here. So I don't know if it's worth changing much code for that. And I don't think the PAGESIZE is necessary for this test, 4k and 64k are all fine for me. The case just trys to make sure 4k/64k can be parsed by fs_parse().

What do you think?

Thanks,
Zorro

Quoted 27 lines
Quoted 9 lines
tests/xfs/513 +0 -0
 do_test "-o allocsize=1048576k" pass "allocsize=1048576k" "true"
 do_test "-o allocsize=$((dbsize / 2))" fail
 do_test "-o allocsize=2g" fail
tests/xfs/513.out +0 -0
index 9be18dd8..2d9f8384 100644

tests/xfs/513.out QA output created by 513 · line 8

Quoted 5 lines
tests/xfs/513.out +1 -1
@@ -5,7 +5,7 @@ QA output created by 513
 ** start xfs mount testing ...
 FORMAT: 
 TEST: "" "pass" "allocsize" "false"
-TEST: "-o allocsize=4k" "pass" "allocsize=4k" "true"
+TEST: "-o allocsize=64k" "pass" "allocsize=64k" "true"

So .out prints "... allocsize=PAGESIZE" ...

Thanks,
Eryu

Quoted 6 lines
tests/xfs/513.out +0 -0
 TEST: "-o allocsize=1048576k" "pass" "allocsize=1048576k" "true"
 TEST: "-o allocsize=2048" "fail"
 TEST: "-o allocsize=2g" "fail"
Signature · 1 line
2.20.1
#3 lore raw
Quoted 22 lines · Zorro Lang
Quoted 21 lines · Eryu Guan
Quoted 5 lines · Zorro Lang

The minimal I/O preallocation size is page size. The allocsize=4k always fails on 64k pagesize machine. So change the fs blocksize allocsize test to allocsize=64k.

I think it's better to make the page size auto-detected, and filter out the actual size to something like "PAGESIZE" in .out file.

Quoted 11 lines
---
 tests/xfs/513     | 4 ++--
 tests/xfs/513.out | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
tests/xfs/513 +0 -0
index 70bc2f1c..3c3f5163 100755
@@ -178,13 +178,13 @@ do_test()
 
Quoted 4 lines
Quoted 4 lines

tests/xfs/513 do_test() · line 181

Quoted 4 lines
tests/xfs/513 +1 -1
 echo "** start xfs mount testing ..."
 # Test allocsize=size
-# Valid values for this option are page size (typically 4KiB) through to 1GiB
+# Valid values for this option are page size through to 1GiB

From this test description, it seems we're not only testing the arg-parsing part, but also testing if kernel could mount the ending fs. So I thought changing 4k to 64k would lose some test coverage, the normal 4k pagesize case is lost.

Quoted 10 lines
Quoted 10 lines

tests/xfs/513 do_test() · line 187

Quoted 7 lines
tests/xfs/513 +1 -1
 do_mkfs
 if [ $dbsize -ge 1024 ];then
 	blsize="$((dbsize / 1024))k"
 fi
 do_test "" pass "allocsize" "false"
-do_test "-o allocsize=$blsize" pass "allocsize=$blsize" "true"
+do_test "-o allocsize=64k" pass "allocsize=64k" "true"

do_test "-o allocsize=PAGESIZE" pass "allocsize=PAGESIZE" "true"

Quoted 7 lines
Quoted 1 line

And do_test converts the "PAGESIZE" to actual page size.

I thought about that too, but due to this case only uses PAGESIZE once at here. So I don't know if it's worth changing much code for that. And I don't think the PAGESIZE is necessary for this test, 4k and 64k are all fine for me. The case just trys to make sure 4k/64k can be parsed by fs_parse().

If it only wants to make sure fs_parse() could parse the arg, then I'm fine with the fix.

Thanks,
Eryu

Quoted 34 lines

What do you think?

Thanks,
Zorro

Quoted 27 lines
Quoted 9 lines
tests/xfs/513 +0 -0
 do_test "-o allocsize=1048576k" pass "allocsize=1048576k" "true"
 do_test "-o allocsize=$((dbsize / 2))" fail
 do_test "-o allocsize=2g" fail
tests/xfs/513.out +0 -0
index 9be18dd8..2d9f8384 100644

tests/xfs/513.out QA output created by 513 · line 8

Quoted 5 lines
tests/xfs/513.out +1 -1
@@ -5,7 +5,7 @@ QA output created by 513
 ** start xfs mount testing ...
 FORMAT: 
 TEST: "" "pass" "allocsize" "false"
-TEST: "-o allocsize=4k" "pass" "allocsize=4k" "true"
+TEST: "-o allocsize=64k" "pass" "allocsize=64k" "true"

So .out prints "... allocsize=PAGESIZE" ...

Thanks,
Eryu

Quoted 6 lines
tests/xfs/513.out +0 -0
 TEST: "-o allocsize=1048576k" "pass" "allocsize=1048576k" "true"
 TEST: "-o allocsize=2048" "fail"
 TEST: "-o allocsize=2g" "fail"
Signature · 1 line
2.20.1