generic: test for non-zero used blocks while writing into a file
[xfstests-dev.git] / tests / btrfs / 121
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (C) 2016 SUSE Linux Products GmbH. All Rights Reserved.
4 #
5 # FS QA Test No. btrfs/121
6 #
7 # Test that an invalid parent qgroup does not cause snapshot create to
8 # force the FS readonly.
9 #
10 # This issue is fixed by the following btrfs patch:
11 #  [PATCH] btrfs: handle non-fatal errors in btrfs_qgroup_inherit()
12 #  http://thread.gmane.org/gmane.comp.file-systems.btrfs/54755
13 #
14 seq=`basename $0`
15 seqres=$RESULT_DIR/$seq
16 echo "QA output created by $seq"
17
18 here=`pwd`
19 tmp=/tmp/$$
20 status=1        # failure is the default!
21 trap "_cleanup; exit \$status" 0 1 2 3 15
22
23 _cleanup()
24 {
25         cd /
26         rm -f $tmp.*
27 }
28
29 # get standard environment, filters and checks
30 . ./common/rc
31 . ./common/filter
32
33 # remove previous $seqres.full before test
34 rm -f $seqres.full
35
36 # real QA test starts here
37 _supported_fs btrfs
38 _require_scratch
39
40 rm -f $seqres.full
41
42 _scratch_mkfs >/dev/null
43 _scratch_mount
44 _run_btrfs_util_prog quota enable $SCRATCH_MNT
45 # The qgroup '1/10' does not exist and should be silently ignored
46 _run_btrfs_util_prog subvolume snapshot -i 1/10 $SCRATCH_MNT $SCRATCH_MNT/snap1
47
48 echo "Silence is golden"
49
50 status=0
51 exit