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 _begin_fstest auto quick qgroup snapshot
13 # Import common functions.
16 # real QA test starts here
18 # Modify as appropriate.
22 _scratch_mkfs >/dev/null
25 $BTRFS_UTIL_PROG subvolume create "$SCRATCH_MNT/src" > /dev/null
26 _pwrite_byte 0xcd 0 16M "$SCRATCH_MNT/src/file" > /dev/null
28 # Sync the fs to ensure data written to disk so that they can be accounted
31 $BTRFS_UTIL_PROG quota enable "$SCRATCH_MNT"
32 $BTRFS_UTIL_PROG quota rescan -w "$SCRATCH_MNT" > /dev/null
33 $BTRFS_UTIL_PROG qgroup create 1/0 "$SCRATCH_MNT"
35 # Create a snapshot with qgroup inherit
36 $BTRFS_UTIL_PROG subvolume snapshot -i 1/0 "$SCRATCH_MNT/src" \
37 "$SCRATCH_MNT/snapshot" > /dev/null
39 echo "Silence is golden"
40 # If qgroup is not marked inconsistent automatically, btrfs check would