Skip to content

Commit

Permalink
Only call spa_man_trim_taskq_destroy() when needed
Browse files Browse the repository at this point in the history
Long zloop runs were occasionally hitting the
"ASSERT(spa->spa_man_trim_taskq != NULL)" in spa_man_trim_taskq_destroy().
It's not clear to me how this was happening because the only place
"spa->spa_man_trim_taskq" is cleared is in spa_man_trim_taskq_destroy()
itself which is only called from the (single) spa_async_thread() or
from spa_unload().

To that end, this commit adds a non-NULL check in spa_async_thread()
analagous to the tests which were added when support for stopping/starting
the auto trim taskqs were added to spa_async_thread().

NOTE: Yes, that means I consider this to be a band-aid.
  • Loading branch information
dweeezil committed Jan 21, 2019
1 parent 9fed38e commit 9efe6c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion module/zfs/spa.c
Original file line number Diff line number Diff line change
Expand Up @@ -7260,7 +7260,8 @@ spa_async_thread(void *arg)
*/
if (tasks & SPA_ASYNC_MAN_TRIM_TASKQ_DESTROY) {
mutex_enter(&spa->spa_man_trim_lock);
spa_man_trim_taskq_destroy(spa);
if (spa->spa_man_trim_taskq != NULL)
spa_man_trim_taskq_destroy(spa);
mutex_exit(&spa->spa_man_trim_lock);
}
if (tasks & SPA_ASYNC_AUTO_TRIM_TASKQ_CREATE) {
Expand Down

0 comments on commit 9efe6c0

Please sign in to comment.