diff --git a/lustre/osd/osd_handler.c b/lustre/osd/osd_handler.c
index 454b9e3cfb01b3d044fb94d9389d8111186a7f83..904b9d717a6e11ba95ea0ecf53371a6e7bbcdf61 100644
--- a/lustre/osd/osd_handler.c
+++ b/lustre/osd/osd_handler.c
@@ -523,17 +523,22 @@ static int osd_inode_remove(const struct lu_env *env, struct osd_object *obj)
         struct osd_device      *osd = osd_obj2dev(obj);
         struct osd_thread_info *oti = osd_oti_get(env);
         struct txn_param       *prm = &oti->oti_txn;
+        struct lu_env          *env_del_obj = &oti->oti_obj_delete_tx_env;
         struct thandle         *th;
         int result;
 
+        lu_env_init(env_del_obj, LCT_DT_THREAD);
         txn_param_init(prm, OSD_TXN_OI_DELETE_CREDITS +
                             OSD_TXN_INODE_DELETE_CREDITS);
-        th = osd_trans_start(env, &osd->od_dt_dev, prm);
+        th = osd_trans_start(env_del_obj, &osd->od_dt_dev, prm);
         if (!IS_ERR(th)) {
-                result = osd_oi_delete(oti, &osd->od_oi, fid, th);
-                osd_trans_stop(env, th);
+                result = osd_oi_delete(osd_oti_get(env_del_obj),
+                                       &osd->od_oi, fid, th);
+                osd_trans_stop(env_del_obj, th);
         } else
                 result = PTR_ERR(th);
+
+        lu_env_fini(env_del_obj);
         return result;
 }
 
diff --git a/lustre/osd/osd_internal.h b/lustre/osd/osd_internal.h
index df1600babdf71bedd9d213294ccc24063225922b..6514dc7b704d18cee79815ea0f3ce47dea685a96 100644
--- a/lustre/osd/osd_internal.h
+++ b/lustre/osd/osd_internal.h
@@ -241,6 +241,7 @@ struct osd_thread_info {
 #ifdef HAVE_QUOTA_SUPPORT
         struct osd_ctxt        oti_ctxt;
 #endif
+        struct lu_env          oti_obj_delete_tx_env;
 };
 
 #ifdef LPROCFS