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 _begin_fstest auto quick clone
12 # Import common functions.
16 # real QA test starts here
18 _require_scratch_reflink
19 _require_no_large_scratch_dev
22 echo "Format and mount"
23 _scratch_mkfs_sized $((512 * 1024 * 1024)) > $seqres.full 2>&1
24 _scratch_mount >> $seqres.full 2>&1
26 testdir=$SCRATCH_MNT/test-$seq
29 echo "Create the original file and reflink to copy1, copy2"
30 blksz="$(_get_block_size $testdir)"
31 _pwrite_byte 0x61 0 $((blksz * 14 + 71)) $testdir/original >> $seqres.full
32 _cp_reflink $testdir/original $testdir/copy1
33 _cp_reflink $testdir/copy1 $testdir/copy2
36 $XFS_GROWFS_PROG $SCRATCH_MNT 2>&1 | _filter_growfs >> $seqres.full
39 echo "Create more reflink copies"
40 _cp_reflink $testdir/original $testdir/copy3
42 $XFS_INFO_PROG $SCRATCH_MNT >> $seqres.full