Whamcloud - gitweb
LU-8746 update: restore tdtd_refcount during failure 88/26888/2
authorwangdi <di.wang@intel.com>
Tue, 21 Mar 2017 14:49:52 +0000 (10:49 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 9 May 2017 03:47:15 +0000 (03:47 +0000)
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 <di.wang@intel.com>
Change-Id: I585cc4ceb37a7f3ddaf38201306e0a331fb43e74
Reviewed-on: https://review.whamcloud.com/26888
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
lustre/target/update_trans.c

index 031c49c..36ab331 100644 (file)
@@ -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));