From: wangdi Date: Tue, 21 Mar 2017 14:49:52 +0000 (-0400) Subject: LU-8746 update: restore tdtd_refcount during failure X-Git-Tag: 2.9.58~57 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F88%2F26888%2F2;p=fs%2Flustre-release.git 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 --- 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));