From 466f5c7ff01adb56dccf6af16c7cd41161f300bb Mon Sep 17 00:00:00 2001 From: Xuezhao Liu Date: Wed, 13 Dec 2023 02:15:13 +0000 Subject: [PATCH] DAOS-14788 container: refine task process in pmap_refresh_cb should register completion callback before task reinit, or the complete cb possibly cannot be triggered. (issue reported by Zhao Zhen ) Required-githooks: true Signed-off-by: Xuezhao Liu --- src/container/cli.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/container/cli.c b/src/container/cli.c index 138566980823..5170b20b66dc 100644 --- a/src/container/cli.c +++ b/src/container/cli.c @@ -668,14 +668,6 @@ pmap_refresh_cb(tse_task_t *task, void *data) else delay = 0; - rc = tse_task_reinit_with_delay(task, delay); - if (rc) { - D_ERROR(DF_UUID": pmap_refresh version (%d:%d), resched" - " failed, "DF_RC"\n", DP_UUID(pool->dp_pool), - pm_ver, cb_arg->pra_pm_ver, DP_RC(rc)); - goto out; - } - rc = tse_task_register_comp_cb(task, pmap_refresh_cb, cb_arg, sizeof(*cb_arg)); if (rc) { @@ -686,6 +678,14 @@ pmap_refresh_cb(tse_task_t *task, void *data) goto out; } + rc = tse_task_reinit_with_delay(task, delay); + if (rc) { + D_ERROR(DF_UUID": pmap_refresh version (%d:%d), resched" + " failed, "DF_RC"\n", DP_UUID(pool->dp_pool), + pm_ver, cb_arg->pra_pm_ver, DP_RC(rc)); + goto out; + } + cb_arg->pra_retry_nr++; D_DEBUG(DB_TRACE, DF_UUID": pmap_refresh version (%d:%d), " "in %d retry\n", DP_UUID(pool->dp_pool), pm_ver,