Skip to content

Commit

Permalink
Fix ztest deadman panic with indirect vdev damage
Browse files Browse the repository at this point in the history
This patch fixes an issue where ztest's deadman thread would
trigger a panic because reconstructing artifically damaged
blocks would take too long to reconstruct. This patch simply
limits how often ztest inflicts split-block damage and how
many segments it can damage when it does.

Signed-off-by: Tom Caputi <[email protected]>
  • Loading branch information
Tom Caputi committed Oct 18, 2018
1 parent 9a81636 commit 1f7f0bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/ztest/ztest.c
Original file line number Diff line number Diff line change
Expand Up @@ -7542,7 +7542,7 @@ main(int argc, char **argv)
* segments can be reconstructed in a reasonable amount of time
* when reconstruction is known to be possible.
*/
zfs_reconstruct_indirect_damage_fraction = 4;
zfs_reconstruct_indirect_damage_fraction = 100;

action.sa_handler = sig_handler;
sigemptyset(&action.sa_mask);
Expand Down
6 changes: 3 additions & 3 deletions module/zfs/vdev_indirect.c
Original file line number Diff line number Diff line change
Expand Up @@ -1598,7 +1598,7 @@ vdev_indirect_splits_damage(indirect_vsd_t *iv, zio_t *zio)
* result in two or less unique copies per indirect_child_t.
* Both may need to be checked in order to reconstruct the block.
* Set iv->iv_attempts_max such that all unique combinations will
* enumerated, but limit the damage to at most 16 indirect splits.
* enumerated, but limit the damage to at most 12 indirect splits.
*/
iv->iv_attempts_max = 1;

Expand All @@ -1616,7 +1616,7 @@ vdev_indirect_splits_damage(indirect_vsd_t *iv, zio_t *zio)
}

iv->iv_attempts_max *= 2;
if (iv->iv_attempts_max > (1ULL << 16)) {
if (iv->iv_attempts_max >= (1ULL << 12)) {
iv->iv_attempts_max = UINT64_MAX;
break;
}
Expand Down Expand Up @@ -1702,7 +1702,7 @@ vdev_indirect_reconstruct_io_done(zio_t *zio)
/*
* If nonzero, every 1/x blocks will be damaged, in order to validate
* reconstruction when there are split segments with damaged copies.
* Known_good will TRUE when reconstruction is known to be possible.
* Known_good will be TRUE when reconstruction is known to be possible.
*/
if (zfs_reconstruct_indirect_damage_fraction != 0 &&
spa_get_random(zfs_reconstruct_indirect_damage_fraction) == 0)
Expand Down

0 comments on commit 1f7f0bf

Please sign in to comment.