mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
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 <behlendorf1@llnl.gov> Signed-off-by: Signed-off-by: Chunwei Chen <tuxoko@gmail.com> Signed-off-by: Tim Chase <tim@chase2k.com> Closes #4331
This commit is contained in:
@@ -2331,7 +2331,15 @@ zpool_do_import(int argc, char **argv)
|
||||
idata.cachefile = cachefile;
|
||||
idata.scan = do_scan;
|
||||
|
||||
/*
|
||||
* Under Linux the zpool_find_import_impl() function leverages the
|
||||
* taskq implementation to parallelize device scanning. It is
|
||||
* therefore necessary to initialize this functionality for the
|
||||
* duration of the zpool_search_import() function.
|
||||
*/
|
||||
thread_init();
|
||||
pools = zpool_search_import(g_zfs, &idata);
|
||||
thread_fini();
|
||||
|
||||
if (pools != NULL && idata.exists &&
|
||||
(argc == 1 || strcmp(argv[0], argv[1]) == 0)) {
|
||||
|
||||
Reference in New Issue
Block a user