staging: erofs: unzip_vle_lz4.c,utils.c: rectify BUG_ONs
remove all redundant BUG_ONs, and turn the rest useful usages to DBG_BUGONs. Signed-off-by: Gao Xiang <gaoxiang25@huawei.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
70b17991d8
commit
b8e076a6ef
2 changed files with 7 additions and 7 deletions
|
@ -79,7 +79,7 @@ int z_erofs_vle_plain_copy(struct page **compressed_pages,
|
||||||
if (compressed_pages[j] != page)
|
if (compressed_pages[j] != page)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
BUG_ON(mirrored[j]);
|
DBG_BUGON(mirrored[j]);
|
||||||
memcpy(percpu_data + j * PAGE_SIZE, dst, PAGE_SIZE);
|
memcpy(percpu_data + j * PAGE_SIZE, dst, PAGE_SIZE);
|
||||||
mirrored[j] = true;
|
mirrored[j] = true;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -23,9 +23,6 @@ struct page *erofs_allocpage(struct list_head *pool, gfp_t gfp)
|
||||||
list_del(&page->lru);
|
list_del(&page->lru);
|
||||||
} else {
|
} else {
|
||||||
page = alloc_pages(gfp | __GFP_NOFAIL, 0);
|
page = alloc_pages(gfp | __GFP_NOFAIL, 0);
|
||||||
|
|
||||||
BUG_ON(page == NULL);
|
|
||||||
BUG_ON(page->mapping != NULL);
|
|
||||||
}
|
}
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
@ -58,7 +55,7 @@ struct erofs_workgroup *erofs_find_workgroup(
|
||||||
/* decrease refcount added by erofs_workgroup_put */
|
/* decrease refcount added by erofs_workgroup_put */
|
||||||
if (unlikely(oldcount == 1))
|
if (unlikely(oldcount == 1))
|
||||||
atomic_long_dec(&erofs_global_shrink_cnt);
|
atomic_long_dec(&erofs_global_shrink_cnt);
|
||||||
BUG_ON(index != grp->index);
|
DBG_BUGON(index != grp->index);
|
||||||
}
|
}
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
return grp;
|
return grp;
|
||||||
|
@ -71,8 +68,11 @@ int erofs_register_workgroup(struct super_block *sb,
|
||||||
struct erofs_sb_info *sbi;
|
struct erofs_sb_info *sbi;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
/* grp->refcount should not < 1 */
|
/* grp shouldn't be broken or used before */
|
||||||
BUG_ON(!atomic_read(&grp->refcount));
|
if (unlikely(atomic_read(&grp->refcount) != 1)) {
|
||||||
|
DBG_BUGON(1);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
err = radix_tree_preload(GFP_NOFS);
|
err = radix_tree_preload(GFP_NOFS);
|
||||||
if (err)
|
if (err)
|
||||||
|
|
Loading…
Reference in a new issue