From: wang di Date: Wed, 14 Jan 2015 13:25:31 +0000 (-0800) Subject: LU-5357 lod: hold thandle during lod_trans_stop X-Git-Tag: 2.6.94~24 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=c236efcd5ed186c5813cc6b11d0b1b12d8ec0734 LU-5357 lod: hold thandle during lod_trans_stop Hold thandle during lod_trans_stop, to avoid the thandle being freed in local transaction stop. Signed-off-by: wang di Change-Id: I2448d725e35b119a61bbfb2e9567446d203bec16 Reviewed-on: http://review.whamcloud.com/13420 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Lai Siyao Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- diff --git a/lustre/lod/lod_dev.c b/lustre/lod/lod_dev.c index 8606df9..e9cf6ce 100644 --- a/lustre/lod/lod_dev.c +++ b/lustre/lod/lod_dev.c @@ -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); }