diff options
author | Brian Behlendorf <[email protected]> | 2016-03-17 15:32:33 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-03-21 10:20:02 -0700 |
commit | 505d9655c9e759a145b4812c654c51c34dbe3425 (patch) | |
tree | 7ad9dfd11ce94dd597a72b61c6d1563e55f6208b /lib | |
parent | fc0c72b1670156622af26562030e84bd56d4cdfb (diff) |
Fix zdb -e and zhack thread_init()
This issue was caused by calling `thread_init()` and `thread_fini()`
multiple times resulting in `kthread_key` being invalid. To resolve
the issue the explicit calls to `thread_init()` and `thread_fini()`
required by the `zpool` command have been moved in to the command.
Consumers such as `zdb` and `zhack` perform the same initialized
through `kernel_init()` and `kernel_fini()`.
Resolving this issue allows multiple additional test cases to
be enabled.
Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Signed-off-by: Chunwei Chen <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Closes #4331
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libzfs/libzfs_import.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libzfs/libzfs_import.c b/lib/libzfs/libzfs_import.c index e4d0d37e4..ca3736a1c 100644 --- a/lib/libzfs/libzfs_import.c +++ b/lib/libzfs/libzfs_import.c @@ -1392,6 +1392,7 @@ zpool_find_import_impl(libzfs_handle_t *hdl, importargs_t *iarg) slice->rn_nozpool = B_FALSE; avl_add(&slice_cache, slice); } + /* * create a thread pool to do all of this in parallel; * rn_nozpool is not protected, so this is racy in that @@ -1401,7 +1402,6 @@ zpool_find_import_impl(libzfs_handle_t *hdl, importargs_t *iarg) * locks in the kernel, so going beyond this doesn't * buy us much. */ - thread_init(); t = taskq_create("z_import", 2 * boot_ncpus, defclsyspri, 2 * boot_ncpus, INT_MAX, TASKQ_PREPOPULATE); for (slice = avl_first(&slice_cache); slice; @@ -1411,7 +1411,6 @@ zpool_find_import_impl(libzfs_handle_t *hdl, importargs_t *iarg) TQ_SLEEP); taskq_wait(t); taskq_destroy(t); - thread_fini(); cookie = NULL; while ((slice = avl_destroy_nodes(&slice_cache, |