-
Notifications
You must be signed in to change notification settings - Fork 71
/
317
executable file
·67 lines (51 loc) · 1.88 KB
/
317
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2024 Western Digital Corporation. All Rights Reserved.
#
# FS QA Test 317
#
# Test that btrfs convert can ony be run to convert to supported profiles on a
# zoned filesystem
#
. ./common/preamble
_begin_fstest auto volume raid convert
_fixed_by_kernel_commit 5906333cc4af \
"btrfs: zoned: don't skip block group profile checks on conventional zones"
. common/filter.btrfs
_supported_fs btrfs
_require_scratch_dev_pool 4
_require_zoned_device "$SCRATCH_DEV"
devs=( $SCRATCH_DEV_POOL )
# Create and mount single device FS
_scratch_mkfs -msingle -dsingle 2>&1 >> $seqres.full || _fail "mkfs failed"
_scratch_mount
# Convert FS to metadata/system DUP
_run_btrfs_balance_start -f -mconvert=dup -sconvert=dup $SCRATCH_MNT 2>&1 |\
_filter_balance_convert
# Convert FS to data DUP, must fail
_run_btrfs_balance_start -dconvert=dup $SCRATCH_MNT 2>&1 |\
_filter_balance_convert
# Add device
$BTRFS_UTIL_PROG device add ${devs[1]} $SCRATCH_MNT | _filter_device_add
# Convert FS to data RAID1, must fail
_run_btrfs_balance_start -dconvert=raid1 $SCRATCH_MNT 2>&1 |\
_filter_balance_convert | head -1
# Convert FS to data RAID0, must fail
_run_btrfs_balance_start -dconvert=raid0 $SCRATCH_MNT 2>&1 |\
_filter_balance_convert | head -1
# Add device
$BTRFS_UTIL_PROG device add ${devs[2]} $SCRATCH_MNT | _filter_device_add
# Convert FS to data RAID5, must fail
_run_btrfs_balance_start -f -dconvert=raid5 $SCRATCH_MNT 2>&1 |\
_filter_balance_convert | head -1
# Add device
$BTRFS_UTIL_PROG device add ${devs[3]} $SCRATCH_MNT | _filter_device_add
# Convert FS to data RAID10, must fail
_run_btrfs_balance_start -dconvert=raid10 $SCRATCH_MNT 2>&1 |\
_filter_balance_convert | head -1
# Convert FS to data RAID6, must fail
_run_btrfs_balance_start -f -dconvert=raid6 $SCRATCH_MNT 2>&1 |\
_filter_balance_convert | head -1
# success, all done
status=0
exit