aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/trans.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/trans.c')
-rw-r--r--fs/gfs2/trans.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c
index 33cd523ec97e..053752d4b27f 100644
--- a/fs/gfs2/trans.c
+++ b/fs/gfs2/trans.c
@@ -87,9 +87,11 @@ void gfs2_trans_end(struct gfs2_sbd *sdp)
87 87
88 if (!tr->tr_touched) { 88 if (!tr->tr_touched) {
89 gfs2_log_release(sdp, tr->tr_reserved); 89 gfs2_log_release(sdp, tr->tr_reserved);
90 gfs2_glock_dq(&tr->tr_t_gh); 90 if (tr->tr_t_gh.gh_gl) {
91 gfs2_holder_uninit(&tr->tr_t_gh); 91 gfs2_glock_dq(&tr->tr_t_gh);
92 kfree(tr); 92 gfs2_holder_uninit(&tr->tr_t_gh);
93 kfree(tr);
94 }
93 return; 95 return;
94 } 96 }
95 97
@@ -105,9 +107,11 @@ void gfs2_trans_end(struct gfs2_sbd *sdp)
105 } 107 }
106 108
107 gfs2_log_commit(sdp, tr); 109 gfs2_log_commit(sdp, tr);
108 gfs2_glock_dq(&tr->tr_t_gh); 110 if (tr->tr_t_gh.gh_gl) {
109 gfs2_holder_uninit(&tr->tr_t_gh); 111 gfs2_glock_dq(&tr->tr_t_gh);
110 kfree(tr); 112 gfs2_holder_uninit(&tr->tr_t_gh);
113 kfree(tr);
114 }
111 115
112 if (sdp->sd_vfs->s_flags & MS_SYNCHRONOUS) 116 if (sdp->sd_vfs->s_flags & MS_SYNCHRONOUS)
113 gfs2_log_flush(sdp, NULL); 117 gfs2_log_flush(sdp, NULL);