Skip to contentSkip to conversation

generic/031: Modify fcollapse arguments to work on non-4k block sized fs instances

PATCH In review Anju T Sudhakar 2 participants 2 messages Nov 24, 2020 – Nov 29, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 generic/031: Modify fcollapse arguments to work on non-4k block sized fs instances

This write vs fcollapse test does a sequence of operations to create a page which has non-contiguous mix of dirty and clean blocks. But when running the test with 64k block size, fallocate returns with EINVAL error, as the offset and length parameters for fcollapse are not multiples of fs blocksize.

Modify the offset and length arguments for fcollapse in the test, to run the test with non-4k block sized fs instances also.

Without the patch:
-------------------

# ./check generic/031
SECTION       -- ext4_test
FSTYP         -- ext4
PLATFORM      -- Linux/ppc64le localhost_ubuntu 4.15.0-15-generic
MKFS_OPTIONS  -- -b 65536 /dev/loop5
MOUNT_OPTIONS -- -o acl,user_xattr /dev/loop5 /mnt2/scratch

QA output created by 031
+fallocate: Invalid argument
+fallocate: Invalid argument
wrote 55756/55756 bytes at offset 185332
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 63394/63394 bytes at offset 133228
...

(Note: Same failure observed for xfs also)

With the patch:
-----------------
v# ./check generic/031

SECTION       -- ext4_test
FSTYP         -- ext4
PLATFORM      -- Linux/ppc64le localhost_ubuntu 4.15.0-15-generic #
MKFS_OPTIONS  -- -b 65536 /dev/loop5

MOUNT_OPTIONS -- -o acl,user_xattr /dev/loop5 /mnt2/scratch

generic/031 2s ... 2s
Ran: generic/031
Passed all 1 tests

SECTION -- ext4_test
=========================
Ran: generic/031
Passed all 1 tests

---
 tests/generic/031     |  6 +++---
 tests/generic/031.out | 14 +++++++-------
 2 files changed, 10 insertions(+), 10 deletions(-)
tests/generic/031 +3 -3
index db84031b..2b253c3c 100755
@@ -41,9 +41,9 @@ _scratch_mount
 
 $XFS_IO_PROG -f \
 	-c "pwrite 185332 55756" \
-	-c "fcollapse 28672 40960" \
-	-c "pwrite 133228 63394" \
-	-c "fcollapse 0 4096" \
+	-c "fcollapse 65536 65536" \
+	-c "pwrite 67692 63394" \
+	-c "fcollapse 0 65536" \
 $testfile | _filter_xfs_io
 
 echo "==== Pre-Remount ==="
tests/generic/031.out +7 -7
index 194bfa45..b096694f 100644
@@ -1,19 +1,19 @@
 QA output created by 031
 wrote 55756/55756 bytes at offset 185332
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 63394/63394 bytes at offset 133228
+wrote 63394/63394 bytes at offset 67692
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 ==== Pre-Remount ===
 00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 *
-0001f860  00 00 00 00 00 00 00 00  00 00 00 00 cd cd cd cd  |................|
-0001f870  cd cd cd cd cd cd cd cd  cd cd cd cd cd cd cd cd  |................|
+00000860  00 00 00 00 00 00 00 00  00 00 00 00 cd cd cd cd  |................|
+00000870  cd cd cd cd cd cd cd cd  cd cd cd cd cd cd cd cd  |................|
 *
-0002fdc0
+0001adc0
 ==== Post-Remount ==
 00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 *
-0001f860  00 00 00 00 00 00 00 00  00 00 00 00 cd cd cd cd  |................|
-0001f870  cd cd cd cd cd cd cd cd  cd cd cd cd cd cd cd cd  |................|
+00000860  00 00 00 00 00 00 00 00  00 00 00 00 cd cd cd cd  |................|
+00000870  cd cd cd cd cd cd cd cd  cd cd cd cd cd cd cd cd  |................|
 *
-0002fdc0
+0001adc0
Signature · 1 line
2.15.1
#1 lore raw
Quoted 57 lines · Anju T Sudhakar

This write vs fcollapse test does a sequence of operations to create a page which has non-contiguous mix of dirty and clean blocks. But when running the test with 64k block size, fallocate returns with EINVAL error, as the offset and length parameters for fcollapse are not multiples of fs blocksize.

Modify the offset and length arguments for fcollapse in the test, to run the test with non-4k block sized fs instances also.

Without the patch:
-------------------

# ./check generic/031
SECTION       -- ext4_test
FSTYP         -- ext4
PLATFORM      -- Linux/ppc64le localhost_ubuntu 4.15.0-15-generic
MKFS_OPTIONS  -- -b 65536 /dev/loop5
MOUNT_OPTIONS -- -o acl,user_xattr /dev/loop5 /mnt2/scratch

QA output created by 031
+fallocate: Invalid argument
+fallocate: Invalid argument
wrote 55756/55756 bytes at offset 185332
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 63394/63394 bytes at offset 133228
...

(Note: Same failure observed for xfs also)

With the patch:
-----------------
v# ./check generic/031

SECTION       -- ext4_test
FSTYP         -- ext4
PLATFORM      -- Linux/ppc64le localhost_ubuntu 4.15.0-15-generic #
MKFS_OPTIONS  -- -b 65536 /dev/loop5

MOUNT_OPTIONS -- -o acl,user_xattr /dev/loop5 /mnt2/scratch

generic/031 2s ... 2s
Ran: generic/031
Passed all 1 tests

SECTION -- ext4_test
=========================
Ran: generic/031
Passed all 1 tests

---
 tests/generic/031     |  6 +++---
 tests/generic/031.out | 14 +++++++-------
 2 files changed, 10 insertions(+), 10 deletions(-)
tests/generic/031 +0 -0
index db84031b..2b253c3c 100755

tests/generic/031 _scratch_mount · line 46

Quoted 9 lines
tests/generic/031 +3 -3
@@ -41,9 +41,9 @@ _scratch_mount
 
 $XFS_IO_PROG -f \
 	-c "pwrite 185332 55756" \
-	-c "fcollapse 28672 40960" \
-	-c "pwrite 133228 63394" \
-	-c "fcollapse 0 4096" \
+	-c "fcollapse 65536 65536" \
+	-c "pwrite 67692 63394" \
+	-c "fcollapse 0 65536" \

I'm wondering if the original bug still reproduce after this change? The test is aimed to execrise partial page writeback in fs blocksize < pagesize case, so the offsets and lens may be the key to reproduce the original bug.

Thanks,
Eryu

Quoted 36 lines
tests/generic/031 +0 -0
 $testfile | _filter_xfs_io
 
 echo "==== Pre-Remount ==="
tests/generic/031.out +7 -7
index 194bfa45..b096694f 100644
@@ -1,19 +1,19 @@
 QA output created by 031
 wrote 55756/55756 bytes at offset 185332
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 63394/63394 bytes at offset 133228
+wrote 63394/63394 bytes at offset 67692
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 ==== Pre-Remount ===
 00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 *
-0001f860  00 00 00 00 00 00 00 00  00 00 00 00 cd cd cd cd  |................|
-0001f870  cd cd cd cd cd cd cd cd  cd cd cd cd cd cd cd cd  |................|
+00000860  00 00 00 00 00 00 00 00  00 00 00 00 cd cd cd cd  |................|
+00000870  cd cd cd cd cd cd cd cd  cd cd cd cd cd cd cd cd  |................|
 *
-0002fdc0
+0001adc0
 ==== Post-Remount ==
 00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 *
-0001f860  00 00 00 00 00 00 00 00  00 00 00 00 cd cd cd cd  |................|
-0001f870  cd cd cd cd cd cd cd cd  cd cd cd cd cd cd cd cd  |................|
+00000860  00 00 00 00 00 00 00 00  00 00 00 00 cd cd cd cd  |................|
+00000870  cd cd cd cd cd cd cd cd  cd cd cd cd cd cd cd cd  |................|
 *
-0002fdc0
+0001adc0
Signature · 1 line
2.15.1