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
32 _require_scratch_reflink
34 _require_xfs_io_command "fiemap"
35 _require_xfs_io_command "cowextsize"
39 echo "Format and mount"
40 _scratch_mkfs > $seqres.full 2>&1
41 _scratch_mount >> $seqres.full 2>&1
43 testdir=$SCRATCH_MNT/test-$seq
46 echo "Set extsz and cowextsz on directory"
47 $XFS_IO_PROG -c "cowextsize 1048576" $testdir >> $seqres.full
49 echo "Create a fake tree structure"
50 seq 1 2 | while read nr; do
51 mkdir "$testdir/dir-$nr"
52 seq 1 4 | while read nnr; do
53 touch "$testdir/dir-$nr/file-$nnr"
58 echo "Check cowextsize settings"
59 seq 1 2 | while read nr; do
60 seq 1 4 | while read nnr; do
61 file="$testdir/dir-$nr/file-$nnr"
62 $XFS_IO_PROG -c "cowextsize" $file | _filter_scratch