diff options
author | Tony Perkins <[email protected]> | 2020-09-27 20:46:22 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2020-11-11 17:06:16 -0800 |
commit | 9bd14b8724717bd344ac0c61378fc60e501c3c13 (patch) | |
tree | a6f4f251cd76d3ef558cdc47052967d7f5758e43 /tests | |
parent | 3fcd737478217ab3f4cc518fadb20e1931f13dfe (diff) |
Start snapdir_iterate traversals to begin wtih the value of zero.
The microzap hash can sometimes be zero for single digit snapnames.
The zap cursor can then have a serialized value of two (for . and ..),
and skip the first entry in the avl tree for the .zfs/snapshot directory
listing, and therefore does not return all snapshots.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Cedric Berger <[email protected]>
Signed-off-by: Tony Perkins <[email protected]>
Closes #11039
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_009_pos.ksh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_009_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_009_pos.ksh index f0682b816..a20fcc4ce 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_009_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_snapshot/zfs_snapshot_009_pos.ksh @@ -12,6 +12,7 @@ # # Copyright (c) 2012, 2016 by Delphix. All rights reserved. +# Copyright (c) 2020 by Datto Inc. All rights reserved. # # @@ -23,6 +24,8 @@ # 2. Create multiple snapshots with a list of valid and invalid # snapshot names # 3. Verify the valid snapshot creation +# 4. Verify creation of snapshots report the correct numbers by +# performing a snapshot directory listing . $STF_SUITE/include/libtest.shlib @@ -34,6 +37,7 @@ function cleanup datasetexists $ds && log_must zfs destroy -r $ds done zfs destroy -r $TESTPOOL/TESTFS4 + zfs destroy -r $TESTPOOL/TESTFS5 } datasets="$TESTPOOL/$TESTFS1 $TESTPOOL/$TESTFS2 $TESTPOOL/$TESTFS3" @@ -112,4 +116,17 @@ log_must zfs rename $TESTPOOL/$TESTFS3/TESTFSA$DATASET_XXX \ log_must zfs snapshot -r $TESTPOOL/$TESTFS1@snap1 $TESTPOOL/$TESTFS2@snap1 \ $TESTPOOL/$TESTFS3@snap1 $TESTPOOL/TESTFS4@snap1 +MYTEST="TESTFS5" +ITERATIONS=10 +NUM_SNAPS=5 +for x in {1..$ITERATIONS}; do + log_must zfs create $TESTPOOL/$MYTEST + for y in {1..$NUM_SNAPS}; do + log_must zfs snapshot $TESTPOOL/$MYTEST@$y + done; + n=$(ls -1 /$TESTPOOL/$MYTEST/.zfs/snapshot | wc -l) + verify_eq $n $NUM_SNAPS "count" + zfs destroy -r $TESTPOOL/$MYTEST; +done; + log_pass "zfs multiple snapshot verified correctly" |