From 083ddb77147aafcd6ddcf1809060eb991a8fd549 Mon Sep 17 00:00:00 2001 From: Pavel Snajdr Date: Thu, 3 Sep 2020 17:38:16 +0200 Subject: [PATCH] Fix stack frame size: spa_livelist_delete_cb() Reviewed-by: Ryan Moeller Reviewed-by: Brian Behlendorf Signed-off-by: Pavel Snajdr Closes #10879 --- module/zfs/spa.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/module/zfs/spa.c b/module/zfs/spa.c index 0bf0e366a9..8c662f6b06 100644 --- a/module/zfs/spa.c +++ b/module/zfs/spa.c @@ -2497,11 +2497,12 @@ spa_livelist_delete_cb(void *arg, zthr_t *z) VERIFY0(dsl_get_next_livelist_obj(mos, zap_obj, &ll_obj)); VERIFY0(zap_count(mos, ll_obj, &count)); if (count > 0) { - dsl_deadlist_t ll = { 0 }; + dsl_deadlist_t *ll; dsl_deadlist_entry_t *dle; bplist_t to_free; - dsl_deadlist_open(&ll, mos, ll_obj); - dle = dsl_deadlist_first(&ll); + ll = kmem_zalloc(sizeof (dsl_deadlist_t), KM_SLEEP); + dsl_deadlist_open(ll, mos, ll_obj); + dle = dsl_deadlist_first(ll); ASSERT3P(dle, !=, NULL); bplist_create(&to_free); int err = dsl_process_sub_livelist(&dle->dle_bpobj, &to_free, @@ -2509,7 +2510,7 @@ spa_livelist_delete_cb(void *arg, zthr_t *z) if (err == 0) { sublist_delete_arg_t sync_arg = { .spa = spa, - .ll = &ll, + .ll = ll, .key = dle->dle_mintxg, .to_free = &to_free }; @@ -2524,7 +2525,8 @@ spa_livelist_delete_cb(void *arg, zthr_t *z) } bplist_clear(&to_free); bplist_destroy(&to_free); - dsl_deadlist_close(&ll); + dsl_deadlist_close(ll); + kmem_free(ll, sizeof (dsl_deadlist_t)); } else { livelist_delete_arg_t sync_arg = { .spa = spa,