mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
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 <behlendorf1@llnl.gov> Reviewed-by: Cedric Berger <cedric@precidata.com> Signed-off-by: Tony Perkins <tperkins@datto.com> Closes #11039
This commit is contained in:
committed by
Brian Behlendorf
parent
87f01fc158
commit
2132ae465d
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user