blob: 021a4b8a522cd26fabd7331e2d3dcf960ee2718f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2020 SUSE Linux Products GmbH. All Rights Reserved.
#
# FS QA Test 210
#
# Test that a new snapshot created with qgroup inherit passed should mark
# qgroup numbers inconsistent.
#
. ./common/preamble
_begin_fstest auto quick qgroup snapshot
. ./common/filter
_supported_fs btrfs
_require_scratch
_scratch_mkfs >/dev/null
_scratch_mount
$BTRFS_UTIL_PROG subvolume create "$SCRATCH_MNT/src" > /dev/null
_pwrite_byte 0xcd 0 16M "$SCRATCH_MNT/src/file" > /dev/null
# Sync the fs to ensure data written to disk so that they can be accounted
# by qgroup
sync
$BTRFS_UTIL_PROG quota enable "$SCRATCH_MNT"
_qgroup_rescan "$SCRATCH_MNT" > /dev/null
$BTRFS_UTIL_PROG qgroup create 1/0 "$SCRATCH_MNT"
# Create a snapshot with qgroup inherit
$BTRFS_UTIL_PROG subvolume snapshot -i 1/0 "$SCRATCH_MNT/src" \
"$SCRATCH_MNT/snapshot" > /dev/null
echo "Silence is golden"
# If qgroup is not marked inconsistent automatically, btrfs check would
# report error.
# success, all done
status=0
exit
|