Skip to content

Commit 922c559

Browse files
author
Paul Dagnelie
committed
Tony feedback
Signed-off-by: Paul Dagnelie <paul.dagnelie@klarasystems.com>
1 parent 6e2791f commit 922c559

17 files changed

+35
-31
lines changed

cmd/zdb/zdb.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9437,7 +9437,7 @@ dummy_get_file_info(dmu_object_type_t bonustype, const void *data,
94379437
}
94389438

94399439
static int
9440-
log_10(uint64_t v) {
9440+
numlen(uint64_t v) {
94419441
char buf[32];
94429442
snprintf(buf, sizeof (buf), "%llu", (u_longlong_t)v);
94439443
return (strlen(buf));
@@ -9497,8 +9497,8 @@ zdb_print_anyraid_tile_layout(vdev_t *vd)
94979497
ASSERT3P(vd->vdev_ops, ==, &vdev_anyraid_ops);
94989498
vdev_anyraid_t *var = vd->vdev_tsd;
94999499
int cols = vd->vdev_children;
9500-
int textwidth = MAX(8, log_10(avl_numnodes(&var->vd_tile_map)) +
9501-
var->vd_nparity > 0 ? log_10(var->vd_nparity + 1) + 1 : 0);
9500+
int textwidth = MAX(8, numlen(avl_numnodes(&var->vd_tile_map)) +
9501+
var->vd_nparity > 0 ? numlen(var->vd_nparity + 1) + 1 : 0);
95029502
int colwidth = textwidth + 2;
95039503

95049504
// Create and populate table with all the values we need to print.

include/sys/fs/zfs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@ typedef struct zpool_load_policy {
910910
#define ZPOOL_CONFIG_DRAID_NGROUPS "draid_ngroups"
911911

912912
/* ANYRAID configuration */
913-
#define ZPOOL_CONFIG_ANYRAID_PARITY_TYPE "parity_type"
913+
#define ZPOOL_CONFIG_ANYRAID_PARITY_TYPE "anyraid_parity_type"
914914

915915
#define VDEV_TYPE_ROOT "root"
916916
#define VDEV_TYPE_MIRROR "mirror"

tests/runfiles/sanity.run

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -269,12 +269,11 @@ tests = ['zpool_create_001_pos', 'zpool_create_002_pos',
269269
'zpool_create_012_neg', 'zpool_create_014_neg', 'zpool_create_015_neg',
270270
'zpool_create_017_neg', 'zpool_create_018_pos', 'zpool_create_019_pos',
271271
'zpool_create_020_pos', 'zpool_create_021_pos', 'zpool_create_022_pos',
272-
'zpool_create_anyraid_001_pos', 'zpool_create_anyraid_002_pos',
273-
'zpool_create_anyraid_003_pos', 'zpool_create_anyraid_004_pos',
274-
'zpool_create_anyraid_005_neg', 'zpool_create_encrypted',
275-
'zpool_create_features_001_pos', 'zpool_create_features_002_pos',
276-
'zpool_create_features_003_pos', 'zpool_create_features_004_neg',
277-
'zpool_create_features_005_pos']
272+
'zpool_create_anyraid_001_pos', 'zpool_create_anyraid_003_pos',
273+
'zpool_create_anyraid_004_pos', 'zpool_create_anyraid_005_neg',
274+
'zpool_create_encrypted', 'zpool_create_features_001_pos',
275+
'zpool_create_features_002_pos', 'zpool_create_features_003_pos',
276+
'zpool_create_features_004_neg', 'zpool_create_features_005_pos']
278277
tags = ['functional', 'cli_root', 'zpool_create']
279278

280279
[tests/functional/cli_root/zpool_destroy]

tests/zfs-tests/include/libtest.shlib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1856,7 +1856,7 @@ function verify_pool
18561856
function get_disklist # pool
18571857
{
18581858
echo $(zpool iostat -v $1 | awk '(NR > 4) {print $1}' | \
1859-
grep -vEe '^-----' -e "^(mirror|raidz[1-3]|anyraid|draid[1-3]|spare|log|cache|special|dedup)|\-[0-9]$")
1859+
grep -vEe '^-----' -e "^(mirror|raidz[1-3]|anymirror|draid[1-3]|spare|log|cache|special|dedup)|\-[0-9]$")
18601860
}
18611861

18621862
#

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,18 @@ for replace_flags in '' '-s'; do
5555

5656
log_must create_sparse_files "disk" 3 $DEVSIZE
5757
log_must create_sparse_files "spare" 1 $DEVSIZE
58-
log_must zpool create -f $TESTPOOL anymirror1 $disks
58+
log_must zpool create -O compress=off -f $TESTPOOL anymirror1 $disks
5959
log_must zfs set primarycache=none $TESTPOOL
6060

6161
# Write initial data
62-
log_must dd if=/dev/urandom of=/$TESTPOOL/file1.bin bs=1M count=$(( DEVSIZE / 2 / 1024 / 1024 ))
62+
log_must file_write -o create -f /$TESTPOOL/file1.bin -b 1048576 -c 256 -d Z
6363

6464
# Fail one disk
6565
log_must truncate -s0 $disk0
6666

6767
# Read initial data, write new data
68-
dd if=/$TESTPOOL/file1.bin of=/dev/null bs=1M count=$(( DEVSIZE / 2 / 1024 / 1024 ))
69-
log_must dd if=/dev/urandom of=/$TESTPOOL/file1.bin bs=1M count=$(( DEVSIZE / 2 / 1024 / 1024 ))
68+
log_must dd if=/$TESTPOOL/file1.bin of=/dev/null bs=1M count=256
69+
log_must file_write -o create -f /$TESTPOOL/file1.bin -b 1048576 -c 256 -d Y
7070

7171
# Check that disk is faulted
7272
zpool status

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,20 @@ typeset newcksum
5656
for parity in {0..3}; do
5757
log_must zpool create -f $TESTPOOL anymirror$parity $disks special mirror $sdisks
5858
log_must poolexists $TESTPOOL
59+
log_must zfs set special_small_blocks=4k $TESTPOOL
5960

60-
log_must dd if=/dev/urandom of=/$TESTPOOL/file.bin bs=1M count=128
61+
log_must dd if=/dev/urandom of=/$TESTPOOL/file.bin bs=1M count=1
62+
log_must dd if=/dev/urandom of=/$TESTPOOL/small.bin bs=4k count=1
6163
oldcksum=$(xxh128digest /$TESTPOOL/file.bin)
64+
oldsmallcksum=$(xxh128digest /$TESTPOOL/small.bin)
6265
log_must zpool export $TESTPOOL
6366

6467
log_must zpool import -d $(dirname $disk0) $TESTPOOL
6568
newcksum=$(xxh128digest /$TESTPOOL/file.bin)
69+
newsmallcksum=$(xxh128digest /$TESTPOOL/small.bin)
6670

6771
log_must test "$oldcksum" = "$newcksum"
72+
log_must test "$oldsmallcksum" = "$newsmallcksum"
6873

6974
log_must destroy_pool $TESTPOOL
7075
done

tests/zfs-tests/tests/functional/cli_root/zfs_mount/zfs_mount.kshlib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function setup_filesystem #disklist #pool #fs #mntpoint #type #vdev
6565
if [[ $vdev != "" && \
6666
$vdev != "mirror" && \
6767
$vdev != "raidz" && \
68-
$vdev != "anyraid" && \
68+
$vdev != "anymirror" && \
6969
$vdev != "draid" ]] ; then
7070

7171
log_note "Wrong vdev: (\"$vdev\")"

tests/zfs-tests/tests/functional/cli_root/zpool_add/zpool_add_009_neg.ksh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ log_must poolexists $TESTPOOL
6464

6565
log_mustnot zpool add -f $TESTPOOL $disk0
6666

67-
for type in "" "mirror" "raidz" "anyraid" "draid" "spare" "log" "dedup" "special" "cache"
67+
for type in "" "mirror" "raidz" "anymirror" "draid" "spare" "log" "dedup" "special" "cache"
6868
do
6969
log_mustnot zpool add -f $TESTPOOL $type $disk0 $disk1
7070
log_mustnot zpool add --allow-in-use $TESTPOOL $type $disk0 $disk1

tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_007_neg.ksh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ set -A args "" "-?" "-n" "-f" "-nf" "-fn" "-f -n" "--f" "-e" "-s" \
5656
"$TESTPOOL mirror" "$TESTPOOL raidz" "$TESTPOOL mirror raidz" \
5757
"$TESTPOOL raidz1" "$TESTPOOL mirror raidz1" \
5858
"$TESTPOOL draid1" "$TESTPOOL mirror draid1" \
59-
"$TESTPOOL anyraid" "$TESTPOOL mirror anyraid" \
59+
"$TESTPOOL anymirror" "$TESTPOOL mirror anymirror" \
6060
"$TESTPOOL anymirror0" "$TESTPOOL mirror anymirror0" \
6161
"$TESTPOOL anymirror1 $DISK0" \
6262
"$TESTPOOL anymirror2 $DISK0 $DISK1" \

tests/zfs-tests/tests/functional/cli_root/zpool_create/zpool_create_anyraid_002_pos.ksh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ function cleanup
4444
{
4545
poolexists $TESTPOOL && destroy_pool $TESTPOOL
4646

47-
rm -f $all_vdevs
48-
rmdir $TESTDIR
47+
log_pos rm -f $all_vdevs
48+
log_pos rmdir $TESTDIR
4949
}
5050

5151
log_assert "'zpool create <pool> anyraid ...' can create a pool with maximum number of vdevs."

0 commit comments

Comments
 (0)