Re: [PATCH v4] generic/808: add a regression test for fiemap into an mmap range

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



On 3/20/24 21:16, Josef Bacik wrote:
Btrfs had a deadlock that you could trigger by mmap'ing a large file and
using that as the buffer for fiemap.  This test adds a c program to do
this, and the fstest creates a large enough file and then runs the
reproducer on the file.  Without the fix btrfs deadlocks, with the fix
we pass fine.

Signed-off-by: Josef Bacik <josef@xxxxxxxxxxxxxx>
---
v3->v4:
- Rework this to use punch-alternating to generate a fragmented file.
- Rework the _require's to reflect the new mode of fragmenting a file.


+# real QA test starts here
+_supported_fs generic
+_require_test
+_require_test_program "fiemap-fault"
+_require_test_program "punch-alternating"
+_require_xfs_io_command "fpunch"
+
+dst=$TEST_DIR/$seq/fiemap-fault
+
+mkdir -p $TEST_DIR/$seq
+
+echo "Silence is golden"
+
+# Generate a file with lots of extents
+blksz=$(_get_file_block_size $TEST_DIR)
+$XFS_IO_PROG -f -c "pwrite -q 0 $((blksz * 10000))" $dst
+$here/src/punch-alternating $dst
+
+# Now run the reproducer
+$here/src/fiemap-fault $dst
+
+# success, all done
+status=$?
+exit

Reviewed-by: Anand Jain <anand.jain@xxxxxxxxxx>

+
A whitespace here, to be addressed during integration.

Thanks, Anand

diff --git a/tests/generic/808.out b/tests/generic/808.out
new file mode 100644
index 00000000..88253428
--- /dev/null
+++ b/tests/generic/808.out
@@ -0,0 +1,2 @@
+QA output created by 808
+Silence is golden





[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux