From 92bbd06e4ddd2505fceaada9cda4bb0974733204 Mon Sep 17 00:00:00 2001 From: wangdi Date: Tue, 21 Mar 2017 10:49:52 -0400 Subject: [PATCH] LU-8746 update: restore tdtd_refcount during failure During batchid_update, tdtd_refcount should be restored once error happens, otherwise tdtd_refcount will not reach 0 which will cause distribute thread hang during umount. Change the distribute thread name to "dist_txn". Signed-off-by: Di Wang Change-Id: I585cc4ceb37a7f3ddaf38201306e0a331fb43e74 Reviewed-on: https://review.whamcloud.com/26888 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Lai Siyao Reviewed-by: Fan Yong --- lustre/target/update_trans.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lustre/target/update_trans.c b/lustre/target/update_trans.c index 031c49c..36ab331 100644 --- a/lustre/target/update_trans.c +++ b/lustre/target/update_trans.c @@ -1420,6 +1420,7 @@ distribute_txn_commit_batchid_update(const struct lu_env *env, th = dt_trans_create(env, tdtd->tdtd_lut->lut_bottom); if (IS_ERR(th)) { + atomic_dec(&tdtd->tdtd_refcount); OBD_FREE_PTR(dtbd); RETURN(PTR_ERR(th)); } @@ -1450,8 +1451,10 @@ distribute_txn_commit_batchid_update(const struct lu_env *env, stop: dt_trans_stop(env, tdtd->tdtd_lut->lut_bottom, th); - if (rc < 0) + if (rc < 0) { + atomic_dec(&tdtd->tdtd_refcount); OBD_FREE_PTR(dtbd); + } RETURN(rc); } @@ -1708,7 +1711,7 @@ int distribute_txn_init(const struct lu_env *env, if (rc != 0) RETURN(rc); - task = kthread_run(distribute_txn_commit_thread, tdtd, "tdtd-%u", + task = kthread_run(distribute_txn_commit_thread, tdtd, "dist_txn-%u", index); if (IS_ERR(task)) RETURN(PTR_ERR(task)); -- 1.8.3.1