2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2009 Christoph Hellwig.
7 # Test out the infamous xfs_btree_delrec corruption.
9 # Only happens on 32-bit kernels without CONFIG_LBD, but it should be harmless
10 # to run this everywhere.
13 _begin_fstest metadata auto quick
15 # Override the default cleanup function.
21 # Import common functions.
24 # real QA test starts here
29 min_align=`_min_dio_alignment $SCRATCH_DEV`
33 offset=`expr $1 \* $min_align`
34 end=`expr $2 \* $min_align`
35 length=`expr $end - $offset`
37 $XFS_IO_PROG -d -f $file -c "pwrite $offset $length" >/dev/null
42 _scratch_mkfs_xfs >/dev/null 2>&1
45 # Create a fragmented file
71 # and truncate it again
72 > $SCRATCH_MNT/bigfile