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.
ZTS: New test for kernel panic induced by redacted send
This change adds a new test that covers a bug fix in the binary search in the redacted send resume logic that causes a kernel panic. The bug was fixed in openzfs#11297. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Co-authored-by: John Kennedy <john.kennedy@delphix.com> Signed-off-by: Palash Gandhi <palash.gandhi@delphix.com> Closes openzfs#11764
- Loading branch information
1 parent
6cda9d2
commit 23b1950
Showing
3 changed files
with
47 additions
and
2 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
44 changes: 44 additions & 0 deletions
44
tests/zfs-tests/tests/functional/redacted_send/redacted_panic.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,44 @@ | ||
#!/bin/ksh | ||
|
||
# | ||
# 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. | ||
# | ||
|
||
# | ||
# Copyright (c) 2021 by Delphix. All rights reserved. | ||
# | ||
|
||
. $STF_SUITE/tests/functional/redacted_send/redacted.kshlib | ||
|
||
# | ||
# Description: | ||
# Verify edge case when midbufid is equal to minbufid for the bug fixed by | ||
# https://github.com/openzfs/zfs/pull/11297 (Fix kernel panic induced by | ||
# redacted send) | ||
# | ||
|
||
typeset ds_name="panic" | ||
typeset sendfs="$POOL/$ds_name" | ||
typeset recvfs="$POOL2/$ds_name" | ||
typeset clone="$POOL/${ds_name}_clone" | ||
typeset stream=$(mktemp $tmpdir/stream.XXXX) | ||
|
||
log_onexit redacted_cleanup $sendfs $recvfs | ||
|
||
log_must zfs create -o recsize=8k $sendfs | ||
log_must dd if=/dev/urandom of=/$sendfs/file bs=1024k count=2048 | ||
log_must zfs snapshot $sendfs@init | ||
log_must zfs clone $sendfs@init $clone | ||
log_must stride_dd -i /dev/urandom -o /$clone/file -b 8192 -s 2 -c 7226 | ||
log_must zfs snapshot $clone@init | ||
log_must zfs redact $sendfs@init book_init $clone@init | ||
log_must eval "zfs send --redact $sendfs#book_init $sendfs@init >$stream" | ||
log_must eval "zfs recv $recvfs <$stream" | ||
log_pass |