OpenZFS 6871 - libzpool implementation of thread_create should enforce length is 0

Porting notes:
- Several direct callers of zk_thread_create() are passing TS_RUN for the
length.  The `len` and `state` were inverted,this commit fixes them.

Authored by: Eli Rosenthal <eli.rosenthal@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Ported-by: George Melikov mail@gmelikov.ru

OpenZFS-issue: https://www.illumos.org/issues/6871
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/8fc9228
Closes #5621
This commit is contained in:
George Melikov
2017-01-24 20:13:49 +03:00
committed by Brian Behlendorf
parent 9ef3906a5a
commit e2a65adbb8
4 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -704,7 +704,7 @@ run_sweep(void)
VERIFY3P(zk_thread_create(NULL, 0,
(thread_func_t)sweep_thread,
(void *) opts, TS_RUN, NULL, 0, 0,
(void *) opts, 0, NULL, TS_RUN, 0,
PTHREAD_CREATE_JOINABLE), !=, NULL);
}
+2 -2
View File
@@ -6240,7 +6240,7 @@ ztest_run(ztest_shared_t *zs)
* Create a thread to periodically resume suspended I/O.
*/
VERIFY3P((resume_thread = zk_thread_create(NULL, 0,
(thread_func_t)ztest_resume_thread, spa, TS_RUN, NULL, 0, 0,
(thread_func_t)ztest_resume_thread, spa, 0, NULL, TS_RUN, 0,
PTHREAD_CREATE_JOINABLE)), !=, NULL);
#if 0
@@ -6296,7 +6296,7 @@ ztest_run(ztest_shared_t *zs)
VERIFY3P(thread = zk_thread_create(NULL, 0,
(thread_func_t)ztest_thread,
(void *)(uintptr_t)t, TS_RUN, NULL, 0, 0,
(void *)(uintptr_t)t, 0, NULL, TS_RUN, 0,
PTHREAD_CREATE_JOINABLE), !=, NULL);
tid[t] = thread->t_tid;
}