Whamcloud - gitweb
LU-5357 lod: hold thandle during lod_trans_stop
[fs/lustre-release.git] / lustre / lod / lod_dev.c
index 8606df9..e9cf6ce 100644 (file)
@@ -591,9 +591,12 @@ static int lod_trans_stop(const struct lu_env *env, struct dt_device *dt,
        int                             rc;
        ENTRY;
 
+       thandle_get(th);
        rc = dt_trans_stop(env, th->th_dev, th);
-       if (likely(tu == NULL))
+       if (likely(tu == NULL)) {
+               thandle_put(th);
                RETURN(rc);
+       }
 
        list_for_each_entry_safe(update, tmp,
                                 &tu->tu_remote_update_list,
@@ -603,6 +606,7 @@ static int lod_trans_stop(const struct lu_env *env, struct dt_device *dt,
                if (unlikely(rc2 != 0 && rc == 0))
                        rc = rc2;
        }
+       thandle_put(th);
 
        RETURN(rc);
 }