aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/meta_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/meta_io.c')
-rw-r--r--fs/gfs2/meta_io.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c
index b6bd2ebfc2cc..ef58d43b67ee 100644
--- a/fs/gfs2/meta_io.c
+++ b/fs/gfs2/meta_io.c
@@ -547,10 +547,12 @@ void gfs2_attach_bufdata(struct gfs2_glock *gl, struct buffer_head *bh, int meta
547{ 547{
548 struct gfs2_bufdata *bd; 548 struct gfs2_bufdata *bd;
549 549
550 lock_page(bh->b_page); 550 if (meta)
551 lock_page(bh->b_page);
551 552
552 if (get_v2bd(bh)) { 553 if (get_v2bd(bh)) {
553 unlock_page(bh->b_page); 554 if (meta)
555 unlock_page(bh->b_page);
554 return; 556 return;
555 } 557 }
556 558
@@ -563,14 +565,16 @@ void gfs2_attach_bufdata(struct gfs2_glock *gl, struct buffer_head *bh, int meta
563 bd->bd_gl = gl; 565 bd->bd_gl = gl;
564 566
565 INIT_LIST_HEAD(&bd->bd_list_tr); 567 INIT_LIST_HEAD(&bd->bd_list_tr);
566 if (meta) 568 if (meta) {
567 lops_init_le(&bd->bd_le, &gfs2_buf_lops); 569 lops_init_le(&bd->bd_le, &gfs2_buf_lops);
568 else 570 } else {
569 lops_init_le(&bd->bd_le, &gfs2_databuf_lops); 571 lops_init_le(&bd->bd_le, &gfs2_databuf_lops);
570 572 get_bh(bh);
573 }
571 set_v2bd(bh, bd); 574 set_v2bd(bh, bd);
572 575
573 unlock_page(bh->b_page); 576 if (meta)
577 unlock_page(bh->b_page);
574} 578}
575 579
576/** 580/**