xfs/007: fix regressions on V4 filesystems
[xfstests-dev.git] / tests / xfs / 127
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2015, Oracle and/or its affiliates.  All Rights Reserved.
4 #
5 # FS QA Test No. 127
6 #
7 # Tests xfs_growfs on a reflinked filesystem
8 #
9 . ./common/preamble
10 _begin_fstest auto quick clone
11
12 # Import common functions.
13 . ./common/filter
14 . ./common/reflink
15
16 # real QA test starts here
17 _supported_fs xfs
18 _require_scratch_reflink
19 _require_no_large_scratch_dev
20 _require_cp_reflink
21
22 echo "Format and mount"
23 _scratch_mkfs_sized $((512 * 1024 * 1024)) > $seqres.full 2>&1
24 _scratch_mount >> $seqres.full 2>&1
25
26 testdir=$SCRATCH_MNT/test-$seq
27 mkdir $testdir
28
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
34
35 echo "Grow fs"
36 $XFS_GROWFS_PROG $SCRATCH_MNT 2>&1 |  _filter_growfs >> $seqres.full
37 _scratch_cycle_mount
38
39 echo "Create more reflink copies"
40 _cp_reflink $testdir/original $testdir/copy3
41
42 $XFS_INFO_PROG $SCRATCH_MNT >> $seqres.full
43
44 # success, all done
45 status=0
46 exit