2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (C) 2020 SUSE Linux Products GmbH. All Rights Reserved.
7 # Test that a new snapshot created with qgroup inherit passed should mark
8 # qgroup numbers inconsistent.
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
16 status=1 # failure is the default!
17 trap "_cleanup; exit \$status" 0 1 2 3 15
25 # get standard environment, filters and checks
29 # remove previous $seqres.full before test
32 # real QA test starts here
34 # Modify as appropriate.
39 _scratch_mkfs >/dev/null
42 $BTRFS_UTIL_PROG subvolume create "$SCRATCH_MNT/src" > /dev/null
43 _pwrite_byte 0xcd 0 16M "$SCRATCH_MNT/src/file" > /dev/null
45 # Sync the fs to ensure data written to disk so that they can be accounted
48 $BTRFS_UTIL_PROG quota enable "$SCRATCH_MNT"
49 $BTRFS_UTIL_PROG quota rescan -w "$SCRATCH_MNT" > /dev/null
50 $BTRFS_UTIL_PROG qgroup create 1/0 "$SCRATCH_MNT"
52 # Create a snapshot with qgroup inherit
53 $BTRFS_UTIL_PROG subvolume snapshot -i 1/0 "$SCRATCH_MNT/src" \
54 "$SCRATCH_MNT/snapshot" > /dev/null
56 echo "Silence is golden"
57 # If qgroup is not marked inconsistent automatically, btrfs check would