2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved.
7 # Make sure setting cowextsz on a directory propagates it to subfiles.
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
31 _require_scratch_reflink
33 _require_xfs_io_command "fiemap"
34 _require_xfs_io_command "cowextsize"
38 echo "Format and mount"
39 _scratch_mkfs > $seqres.full 2>&1
40 _scratch_mount >> $seqres.full 2>&1
42 testdir=$SCRATCH_MNT/test-$seq
45 echo "Set extsz and cowextsz on directory"
46 $XFS_IO_PROG -c "cowextsize 1048576" $testdir >> $seqres.full
48 echo "Create a fake tree structure"
49 seq 1 2 | while read nr; do
50 mkdir "$testdir/dir-$nr"
51 seq 1 4 | while read nnr; do
52 touch "$testdir/dir-$nr/file-$nnr"
57 echo "Check cowextsize settings"
58 seq 1 2 | while read nr; do
59 seq 1 4 | while read nnr; do
60 file="$testdir/dir-$nr/file-$nnr"
61 $XFS_IO_PROG -c "cowextsize" $file | _filter_scratch