f2fs: add an option to avoid unnecessary BUG_ONs
[deliverable/linux.git] / fs / f2fs / recovery.c
index b278c68b3e0801d0a14454f7e96b74076507ba62..fdc81161f2543a4818e371946ba691515aa9f3c4 100644 (file)
@@ -311,8 +311,8 @@ static int do_recover_data(struct f2fs_sb_info *sbi, struct inode *inode,
        wait_on_page_writeback(dn.node_page);
 
        get_node_info(sbi, dn.nid, &ni);
-       BUG_ON(ni.ino != ino_of_node(page));
-       BUG_ON(ofs_of_node(dn.node_page) != ofs_of_node(page));
+       f2fs_bug_on(ni.ino != ino_of_node(page));
+       f2fs_bug_on(ofs_of_node(dn.node_page) != ofs_of_node(page));
 
        for (; start < end; start++) {
                block_t src, dest;
@@ -322,9 +322,9 @@ static int do_recover_data(struct f2fs_sb_info *sbi, struct inode *inode,
 
                if (src != dest && dest != NEW_ADDR && dest != NULL_ADDR) {
                        if (src == NULL_ADDR) {
-                               int err = reserve_new_block(&dn);
+                               err = reserve_new_block(&dn);
                                /* We should not get -ENOSPC */
-                               BUG_ON(err);
+                               f2fs_bug_on(err);
                        }
 
                        /* Check the previous node page having this index */
@@ -447,7 +447,7 @@ int recover_fsync_data(struct f2fs_sb_info *sbi)
 
        /* step #2: recover data */
        err = recover_data(sbi, &inode_list, CURSEG_WARM_NODE);
-       BUG_ON(!list_empty(&inode_list));
+       f2fs_bug_on(!list_empty(&inode_list));
 out:
        destroy_fsync_dnodes(&inode_list);
        kmem_cache_destroy(fsync_entry_slab);
This page took 0.034269 seconds and 5 git commands to generate.