aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/mballoc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/mballoc.c')
-rw-r--r--fs/ext4/mballoc.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 7beab7141dd5..edb512b2ec49 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2553,7 +2553,8 @@ int ext4_mb_init(struct super_block *sb, int needs_recovery)
2553 ext4_mb_init_per_dev_proc(sb); 2553 ext4_mb_init_per_dev_proc(sb);
2554 ext4_mb_history_init(sb); 2554 ext4_mb_history_init(sb);
2555 2555
2556 sbi->s_journal->j_commit_callback = release_blocks_on_commit; 2556 if (sbi->s_journal)
2557 sbi->s_journal->j_commit_callback = release_blocks_on_commit;
2557 2558
2558 printk(KERN_INFO "EXT4-fs: mballoc enabled\n"); 2559 printk(KERN_INFO "EXT4-fs: mballoc enabled\n");
2559 return 0; 2560 return 0;
@@ -2854,7 +2855,7 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,
2854 mb_set_bits(sb_bgl_lock(sbi, ac->ac_b_ex.fe_group), 2855 mb_set_bits(sb_bgl_lock(sbi, ac->ac_b_ex.fe_group),
2855 bitmap_bh->b_data, ac->ac_b_ex.fe_start, 2856 bitmap_bh->b_data, ac->ac_b_ex.fe_start,
2856 ac->ac_b_ex.fe_len); 2857 ac->ac_b_ex.fe_len);
2857 err = ext4_journal_dirty_metadata(handle, bitmap_bh); 2858 err = ext4_handle_dirty_metadata(handle, NULL, bitmap_bh);
2858 if (!err) 2859 if (!err)
2859 err = -EAGAIN; 2860 err = -EAGAIN;
2860 goto out_err; 2861 goto out_err;
@@ -2901,10 +2902,10 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,
2901 spin_unlock(sb_bgl_lock(sbi, flex_group)); 2902 spin_unlock(sb_bgl_lock(sbi, flex_group));
2902 } 2903 }
2903 2904
2904 err = ext4_journal_dirty_metadata(handle, bitmap_bh); 2905 err = ext4_handle_dirty_metadata(handle, NULL, bitmap_bh);
2905 if (err) 2906 if (err)
2906 goto out_err; 2907 goto out_err;
2907 err = ext4_journal_dirty_metadata(handle, gdp_bh); 2908 err = ext4_handle_dirty_metadata(handle, NULL, gdp_bh);
2908 2909
2909out_err: 2910out_err:
2910 sb->s_dirt = 1; 2911 sb->s_dirt = 1;
@@ -4414,7 +4415,7 @@ ext4_mb_free_metadata(handle_t *handle, struct ext4_buddy *e4b,
4414 struct rb_node **n = &db->bb_free_root.rb_node, *node; 4415 struct rb_node **n = &db->bb_free_root.rb_node, *node;
4415 struct rb_node *parent = NULL, *new_node; 4416 struct rb_node *parent = NULL, *new_node;
4416 4417
4417 4418 BUG_ON(!ext4_handle_valid(handle));
4418 BUG_ON(e4b->bd_bitmap_page == NULL); 4419 BUG_ON(e4b->bd_bitmap_page == NULL);
4419 BUG_ON(e4b->bd_buddy_page == NULL); 4420 BUG_ON(e4b->bd_buddy_page == NULL);
4420 4421
@@ -4600,7 +4601,7 @@ do_more:
4600 4601
4601 /* We dirtied the bitmap block */ 4602 /* We dirtied the bitmap block */
4602 BUFFER_TRACE(bitmap_bh, "dirtied bitmap block"); 4603 BUFFER_TRACE(bitmap_bh, "dirtied bitmap block");
4603 err = ext4_journal_dirty_metadata(handle, bitmap_bh); 4604 err = ext4_handle_dirty_metadata(handle, NULL, bitmap_bh);
4604 4605
4605 if (ac) { 4606 if (ac) {
4606 ac->ac_b_ex.fe_group = block_group; 4607 ac->ac_b_ex.fe_group = block_group;
@@ -4609,7 +4610,7 @@ do_more:
4609 ext4_mb_store_history(ac); 4610 ext4_mb_store_history(ac);
4610 } 4611 }
4611 4612
4612 if (metadata) { 4613 if (metadata && ext4_handle_valid(handle)) {
4613 /* blocks being freed are metadata. these blocks shouldn't 4614 /* blocks being freed are metadata. these blocks shouldn't
4614 * be used until this transaction is committed */ 4615 * be used until this transaction is committed */
4615 ext4_mb_free_metadata(handle, &e4b, block_group, bit, count); 4616 ext4_mb_free_metadata(handle, &e4b, block_group, bit, count);
@@ -4639,7 +4640,7 @@ do_more:
4639 4640
4640 /* And the group descriptor block */ 4641 /* And the group descriptor block */
4641 BUFFER_TRACE(gd_bh, "dirtied group descriptor block"); 4642 BUFFER_TRACE(gd_bh, "dirtied group descriptor block");
4642 ret = ext4_journal_dirty_metadata(handle, gd_bh); 4643 ret = ext4_handle_dirty_metadata(handle, NULL, gd_bh);
4643 if (!err) 4644 if (!err)
4644 err = ret; 4645 err = ret;
4645 4646