Skip to content

Commit 1b671cb

Browse files
ihoroPaul Dagnelie
authored andcommitted
Update and add test cases
Signed-off-by: Paul Dagnelie <[email protected]> Sponsored-by: Eshtek, creators of HexOS Sponsored-by: Klara, Inc.
1 parent 3dfd72c commit 1b671cb

25 files changed

+463
-34
lines changed

cmd/zpool/zpool_vdev.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1637,7 +1637,12 @@ construct_spec(nvlist_t *props, int argc, char **argv)
16371637
}
16381638

16391639
if (is_log) {
1640-
if (strcmp(type, VDEV_TYPE_MIRROR) != 0) {
1640+
/*
1641+
* TODO: only AnyRAID mirror is expected to be
1642+
* allowed.
1643+
*/
1644+
if (strcmp(type, VDEV_TYPE_MIRROR) != 0 &&
1645+
strcmp(type, VDEV_TYPE_ANYRAID) != 0) {
16411646
(void) fprintf(stderr,
16421647
gettext("invalid vdev "
16431648
"specification: unsupported 'log' "

module/os/freebsd/zfs/sysctl_os.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@
9393
#include <sys/vmmeter.h>
9494

9595
SYSCTL_DECL(_vfs_zfs);
96+
SYSCTL_NODE(_vfs_zfs, OID_AUTO, anyraid, CTLFLAG_RW, 0,
97+
"ZFS AnyRAID VDEV");
9698
SYSCTL_NODE(_vfs_zfs, OID_AUTO, arc, CTLFLAG_RW, 0,
9799
"ZFS adaptive replacement cache");
98100
SYSCTL_NODE(_vfs_zfs, OID_AUTO, brt, CTLFLAG_RW, 0,
@@ -125,8 +127,6 @@ SYSCTL_NODE(_vfs_zfs, OID_AUTO, zio, CTLFLAG_RW, 0, "ZFS ZIO");
125127

126128
SYSCTL_NODE(_vfs_zfs_livelist, OID_AUTO, condense, CTLFLAG_RW, 0,
127129
"ZFS livelist condense");
128-
SYSCTL_NODE(_vfs_zfs_vdev, OID_AUTO, anyraid, CTLFLAG_RW, 0,
129-
"ZFS AnyRAID VDEV");
130130
SYSCTL_NODE(_vfs_zfs_vdev, OID_AUTO, file, CTLFLAG_RW, 0, "ZFS VDEV file");
131131
SYSCTL_NODE(_vfs_zfs_vdev, OID_AUTO, mirror, CTLFLAG_RD, 0,
132132
"ZFS VDEV mirror");

module/zfs/vdev_anyraid.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,7 @@ vdev_anyraid_fini(vdev_t *vd)
197197
vdev_anyraid_t *var = vd->vdev_tsd;
198198
avl_destroy(&var->vd_tile_map);
199199

200-
201200
vdev_anyraid_node_t *node;
202-
203201
void *cookie = NULL;
204202
while ((node = avl_destroy_nodes(&var->vd_children_tree, &cookie))) {
205203
kmem_free(node, sizeof (*node));

tests/runfiles/common.run

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ tags = ['functional', 'alloc_class']
4242

4343
[tests/functional/anyraid]
4444
tests = [ 'anyraid_clean_mirror_001_pos', 'anyraid_clean_mirror_002_pos',
45-
'anyraid_clean_mirror_003_pos', 'anyraid_tile_layout', 'anyraid_checkpoint']
45+
'anyraid_clean_mirror_003_pos', 'anyraid_tile_layout', 'anyraid_checkpoint',
46+
'anyraid_faildisk_write_replace_resilver',
47+
'anyraid_offline_write_online_resilver',
48+
'anyraid_special_vdev_001_pos', 'anyraid_special_vdev_002_pos']
4649
tags = ['functional', 'anyraid']
4750

4851
[tests/functional/append]

tests/zfs-tests/include/commands.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ export SYSTEM_FILES_COMMON='awk
5252
ldd
5353
ln
5454
ls
55-
md5sum
5655
mkdir
5756
mknod
5857
mkfifo

tests/zfs-tests/tests/Makefile.am

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,11 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \
438438
functional/anyraid/anyraid_clean_mirror_001_pos.ksh \
439439
functional/anyraid/anyraid_clean_mirror_002_pos.ksh \
440440
functional/anyraid/anyraid_clean_mirror_003_pos.ksh \
441+
functional/anyraid/anyraid_faildisk_write_replace_resilver.ksh \
442+
functional/anyraid/anyraid_offline_write_online_resilver.ksh \
441443
functional/anyraid/anyraid_tile_layout.ksh \
444+
functional/anyraid/anyraid_special_vdev_001_pos.ksh \
445+
functional/anyraid/anyraid_special_vdev_002_pos.ksh \
442446
functional/anyraid/cleanup.ksh \
443447
functional/anyraid/setup.ksh \
444448
functional/append/file_append.ksh \

tests/zfs-tests/tests/functional/anyraid/anyraid_clean_mirror_001_pos.ksh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ log_assert "AnyRAID mirror1 can survive having 1 failed disk"
4343

4444
log_must create_sparse_files "disk" 3 $DEVSIZE
4545

46-
spec_cases "anyraid1 $disk0 $disk1" \
46+
clean_mirror_spec_cases "anyraid1 $disk0 $disk1" \
4747
"$disk0" \
4848
"$disk1"
4949

50-
spec_cases "anyraid1 $disk0 $disk1 $disk2" \
50+
clean_mirror_spec_cases "anyraid1 $disk0 $disk1 $disk2" \
5151
"$disk0" \
5252
"$disk1" \
5353
"$disk2"

tests/zfs-tests/tests/functional/anyraid/anyraid_clean_mirror_002_pos.ksh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ log_assert "AnyRAID mirror2 can survive having 1-2 failed disks"
4343

4444
log_must create_sparse_files "disk" 4 $DEVSIZE
4545

46-
spec_cases "anyraid2 $disk0 $disk1 $disk2" \
46+
clean_mirror_spec_cases "anyraid2 $disk0 $disk1 $disk2" \
4747
"$disk0" \
4848
"$disk1" \
4949
"$disk2" \
5050
"\"$disk0 $disk1\"" \
5151
"\"$disk0 $disk2\"" \
5252
"\"$disk1 $disk2\""
5353

54-
spec_cases "anyraid2 $disk0 $disk1 $disk2 $disk3" \
54+
clean_mirror_spec_cases "anyraid2 $disk0 $disk1 $disk2 $disk3" \
5555
"$disk0" \
5656
"$disk1" \
5757
"$disk2" \

tests/zfs-tests/tests/functional/anyraid/anyraid_clean_mirror_003_pos.ksh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ log_assert "AnyRAID mirror3 can survive having 1-3 failed disks"
4343

4444
log_must create_sparse_files "disk" 4 $DEVSIZE
4545

46-
spec_cases "anyraid3 $disk0 $disk1 $disk2 $disk3" \
46+
clean_mirror_spec_cases "anyraid3 $disk0 $disk1 $disk2 $disk3" \
4747
"$disk0" \
4848
"$disk1" \
4949
"$disk2" \

tests/zfs-tests/tests/functional/anyraid/anyraid_common.kshlib

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function wipe_some_disks_and_verify_content_is_still_okay
4141
files[$atfile]=/$pool/file.$atfile
4242
log_must file_write -o create -f ${files[$atfile]} \
4343
-b $FILE_SIZE -c 1
44-
cksums[$atfile]=$(md5sum ${files[$atfile]})
44+
cksums[$atfile]=$(xxh128digest ${files[$atfile]})
4545
(( atfile = atfile + 1 ))
4646
done
4747

@@ -61,7 +61,7 @@ function wipe_some_disks_and_verify_content_is_still_okay
6161
atfile=0
6262
typeset -i failedcount=0
6363
while (( atfile < FILE_COUNT )); do
64-
newcksum=$(md5sum ${files[$atfile]})
64+
newcksum=$(xxh128digest ${files[$atfile]})
6565
if [[ $newcksum != ${cksums[$atfile]} ]]; then
6666
(( failedcount = failedcount + 1 ))
6767
log_note "Wrong checksum of ${files[$atfile]}"
@@ -80,7 +80,7 @@ function wipe_some_disks_and_verify_content_is_still_okay
8080
log_must zpool status
8181
}
8282

83-
function spec_cases
83+
function clean_mirror_spec_cases
8484
{
8585
typeset poolspec=$1
8686
shift

0 commit comments

Comments
 (0)