forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle and detect openzfs#13709's unlock regression
In openzfs#13709, as in openzfs#11294 before it, it turns out that 63a2645 still had the same failure mode as when it was first landed as d1d4769, and fails to unlock certain datasets that formerly worked. Rather than reverting it again, let's add handling to just throw out the accounting metadata that failed to unlock when that happens, as well as a test with a pre-broken pool image to ensure that we never get bitten by this again. Fixes: openzfs#13709 Signed-off-by: Rich Ercolani <[email protected]>
- Loading branch information
1 parent
0b2428d
commit 7bcad26
Showing
5 changed files
with
64 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
45 changes: 45 additions & 0 deletions
45
tests/zfs-tests/tests/functional/userquota/userspace_encrypted_13709.ksh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/ksh -p | ||
# | ||
# This file and its contents are supplied under the terms of the | ||
# Common Development and Distribution License ("CDDL"), version 1.0. | ||
# You may only use this file in accordance with the terms of version | ||
# 1.0 of the CDDL. | ||
# | ||
# A full copy of the text of the CDDL should have accompanied this | ||
# source. A copy of the CDDL is also available via the Internet at | ||
# http://www.illumos.org/license/CDDL. | ||
# | ||
|
||
. $STF_SUITE/include/libtest.shlib | ||
. $STF_SUITE/tests/functional/userquota/userquota_common.kshlib | ||
|
||
# | ||
# DESCRIPTION: | ||
# Avoid allowing #11294/#13709 to recur a third time. | ||
# | ||
# So we hardcode a copy of a pool with this bug, try unlocking it, | ||
# and fail on error. Simple. | ||
|
||
function cleanup | ||
{ | ||
destroy_pool $POOLNAME | ||
rm -f $FILEDEV | ||
} | ||
|
||
log_onexit cleanup | ||
|
||
FILEDEV="$TEST_BASE_DIR/userspace_13709" | ||
POOLNAME="testpool_13709" | ||
|
||
log_assert "ZFS should be able to unlock pools with #13709's failure mode" | ||
|
||
log_must bzcat $STF_SUITE/tests/functional/userquota/13709_reproducer.bz2 > $FILEDEV | ||
|
||
log_must zpool import -d $FILEDEV $POOLNAME | ||
|
||
echo -e 'password\npassword\n' | log_must zfs mount -al | ||
|
||
# Cleanup | ||
cleanup | ||
|
||
log_pass "#13709 not happening here" |