2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2015, Oracle and/or its affiliates. All Rights Reserved.
7 # Tests xfs_growfs on a reflinked filesystem
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
24 # get standard environment, filters and checks
29 # real QA test starts here
32 _require_scratch_reflink
33 _require_no_large_scratch_dev
36 echo "Format and mount"
37 _scratch_mkfs_sized $((512 * 1024 * 1024)) > $seqres.full 2>&1
38 _scratch_mount >> $seqres.full 2>&1
40 testdir=$SCRATCH_MNT/test-$seq
43 echo "Create the original file and reflink to copy1, copy2"
44 blksz="$(_get_block_size $testdir)"
45 _pwrite_byte 0x61 0 $((blksz * 14 + 71)) $testdir/original >> $seqres.full
46 _cp_reflink $testdir/original $testdir/copy1
47 _cp_reflink $testdir/copy1 $testdir/copy2
50 $XFS_GROWFS_PROG $SCRATCH_MNT 2>&1 | _filter_growfs >> $seqres.full
53 echo "Create more reflink copies"
54 _cp_reflink $testdir/original $testdir/copy3
56 $XFS_INFO_PROG $SCRATCH_MNT >> $seqres.full