]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/gfs2/trans.c
udf: Fix oops when invalid character in filename occurs
[linux-2.6-omap-h63xx.git] / fs / gfs2 / trans.c
index f677b8a83f0cc2d0d3cb7c1ebbee47908620a440..053752d4b27f0c3dc52578c5066245e0fb793c69 100644 (file)
@@ -12,9 +12,8 @@
 #include <linux/spinlock.h>
 #include <linux/completion.h>
 #include <linux/buffer_head.h>
-#include <linux/gfs2_ondisk.h>
 #include <linux/kallsyms.h>
-#include <linux/lm_interface.h>
+#include <linux/gfs2_ondisk.h>
 
 #include "gfs2.h"
 #include "incore.h"
@@ -88,9 +87,11 @@ void gfs2_trans_end(struct gfs2_sbd *sdp)
 
        if (!tr->tr_touched) {
                gfs2_log_release(sdp, tr->tr_reserved);
-               gfs2_glock_dq(&tr->tr_t_gh);
-               gfs2_holder_uninit(&tr->tr_t_gh);
-               kfree(tr);
+               if (tr->tr_t_gh.gh_gl) {
+                       gfs2_glock_dq(&tr->tr_t_gh);
+                       gfs2_holder_uninit(&tr->tr_t_gh);
+                       kfree(tr);
+               }
                return;
        }
 
@@ -106,9 +107,11 @@ void gfs2_trans_end(struct gfs2_sbd *sdp)
        }
 
        gfs2_log_commit(sdp, tr);
-        gfs2_glock_dq(&tr->tr_t_gh);
-        gfs2_holder_uninit(&tr->tr_t_gh);
-        kfree(tr);
+       if (tr->tr_t_gh.gh_gl) {
+               gfs2_glock_dq(&tr->tr_t_gh);
+               gfs2_holder_uninit(&tr->tr_t_gh);
+               kfree(tr);
+       }
 
        if (sdp->sd_vfs->s_flags & MS_SYNCHRONOUS)
                gfs2_log_flush(sdp, NULL);