aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/lops.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/lops.c')
-rw-r--r--fs/gfs2/lops.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c
index 6c27cea761c6..e901f8f7d650 100644
--- a/fs/gfs2/lops.c
+++ b/fs/gfs2/lops.c
@@ -556,17 +556,20 @@ static void databuf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le)
556 556
557 lock_buffer(bd->bd_bh); 557 lock_buffer(bd->bd_bh);
558 gfs2_log_lock(sdp); 558 gfs2_log_lock(sdp);
559 if (!list_empty(&bd->bd_list_tr)) 559 if (tr) {
560 goto out; 560 if (!list_empty(&bd->bd_list_tr))
561 tr->tr_touched = 1; 561 goto out;
562 if (gfs2_is_jdata(ip)) { 562 tr->tr_touched = 1;
563 tr->tr_num_buf++; 563 if (gfs2_is_jdata(ip)) {
564 list_add(&bd->bd_list_tr, &tr->tr_list_buf); 564 tr->tr_num_buf++;
565 list_add(&bd->bd_list_tr, &tr->tr_list_buf);
566 }
565 } 567 }
566 if (!list_empty(&le->le_list)) 568 if (!list_empty(&le->le_list))
567 goto out; 569 goto out;
568 570
569 __glock_lo_add(sdp, &bd->bd_gl->gl_le); 571 if (tr)
572 __glock_lo_add(sdp, &bd->bd_gl->gl_le);
570 if (gfs2_is_jdata(ip)) { 573 if (gfs2_is_jdata(ip)) {
571 gfs2_pin(sdp, bd->bd_bh); 574 gfs2_pin(sdp, bd->bd_bh);
572 tr->tr_num_databuf_new++; 575 tr->tr_num_databuf_new++;