|
@@ -1199,8 +1199,9 @@ static int __issue_discard_cmd(struct f2fs_sb_info *sbi,
|
|
|
mutex_lock(&dcc->cmd_lock);
|
|
|
if (list_empty(pend_list))
|
|
|
goto next;
|
|
|
- f2fs_bug_on(sbi,
|
|
|
- !f2fs_check_rb_tree_consistence(sbi, &dcc->root));
|
|
|
+ if (unlikely(dcc->rbtree_check))
|
|
|
+ f2fs_bug_on(sbi, !f2fs_check_rb_tree_consistence(sbi,
|
|
|
+ &dcc->root));
|
|
|
blk_start_plug(&plug);
|
|
|
list_for_each_entry_safe(dc, tmp, pend_list, list) {
|
|
|
f2fs_bug_on(sbi, dc->state != D_PREP);
|
|
@@ -1752,6 +1753,7 @@ static int create_discard_cmd_control(struct f2fs_sb_info *sbi)
|
|
|
dcc->max_discards = MAIN_SEGS(sbi) << sbi->log_blocks_per_seg;
|
|
|
dcc->undiscard_blks = 0;
|
|
|
dcc->root = RB_ROOT;
|
|
|
+ dcc->rbtree_check = false;
|
|
|
|
|
|
init_waitqueue_head(&dcc->discard_wait_queue);
|
|
|
SM_I(sbi)->dcc_info = dcc;
|
|
@@ -2381,7 +2383,9 @@ next:
|
|
|
issued = 0;
|
|
|
|
|
|
mutex_lock(&dcc->cmd_lock);
|
|
|
- f2fs_bug_on(sbi, !f2fs_check_rb_tree_consistence(sbi, &dcc->root));
|
|
|
+ if (unlikely(dcc->rbtree_check))
|
|
|
+ f2fs_bug_on(sbi, !f2fs_check_rb_tree_consistence(sbi,
|
|
|
+ &dcc->root));
|
|
|
|
|
|
dc = (struct discard_cmd *)f2fs_lookup_rb_tree_ret(&dcc->root,
|
|
|
NULL, start,
|