diff options
author | Brian Behlendorf <[email protected]> | 2018-10-01 10:36:34 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2018-10-01 10:36:34 -0700 |
commit | 1258bd778e8279a4cd051543827f333fe2daed76 (patch) | |
tree | 8c478c1fe49a126967310e90b185fc1cccb8a310 /cmd | |
parent | d12614521a307c709778e5f7f91ae6085f63f9e0 (diff) |
Refine split block reconstruction
Due to a flaw in 4589f3ae the number of unique combinations
could be calculated incorrectly. This could result in the
random combinations reconstruction being used when it would
have been possible to check all combinations.
This change fixes the unique combinations calculation and
simplifies the reconstruction logic by maintaining a per-
segment list of unique copies.
The vdev_indirect_splits_damage() function was introduced
to validate both the enumeration and random reconstruction
logic with ztest. It is implemented such it will never
make a known recoverable block unrecoverable.
Reviewed-by: Matthew Ahrens <[email protected]>
Reviewed-by: Serapheim Dimitropoulos <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Issue #6900
Closes #7934
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/ztest/ztest.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c index ae25957dc..f4dc0d1b1 100644 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@ -214,6 +214,7 @@ extern int zfs_abd_scatter_enabled; extern int dmu_object_alloc_chunk_shift; extern boolean_t zfs_force_some_double_word_sm_entries; extern unsigned long zio_decompress_fail_fraction; +extern unsigned long zfs_reconstruct_indirect_damage_fraction; static ztest_shared_opts_t *ztest_shared_opts; static ztest_shared_opts_t ztest_opts; @@ -6479,7 +6480,7 @@ ztest_run_zdb(char *pool) (void) sprintf(zdb, "%s -bcc%s%s -G -d -U %s " - "-o zfs_reconstruct_indirect_combinations_max=1000000 %s", + "-o zfs_reconstruct_indirect_combinations_max=65536 %s", bin, ztest_opts.zo_verbose >= 3 ? "s" : "", ztest_opts.zo_verbose >= 4 ? "v" : "", @@ -7518,6 +7519,13 @@ main(int argc, char **argv) */ zfs_force_some_double_word_sm_entries = B_TRUE; + /* + * Verify that even extensively damaged split blocks with many + * segments can be reconstructed in a reasonable amount of time + * when reconstruction is known to be possible. + */ + zfs_reconstruct_indirect_damage_fraction = 4; + action.sa_handler = sig_handler; sigemptyset(&action.sa_mask); action.sa_flags = 0; |