|
|
@@ -40,7 +40,6 @@ static int erofs_init_inode_cache(void)
|
|
|
|
|
|
static void erofs_exit_inode_cache(void)
|
|
|
{
|
|
|
- BUG_ON(erofs_inode_cachep == NULL);
|
|
|
kmem_cache_destroy(erofs_inode_cachep);
|
|
|
}
|
|
|
|
|
|
@@ -265,8 +264,8 @@ static int managed_cache_releasepage(struct page *page, gfp_t gfp_mask)
|
|
|
int ret = 1; /* 0 - busy */
|
|
|
struct address_space *const mapping = page->mapping;
|
|
|
|
|
|
- BUG_ON(!PageLocked(page));
|
|
|
- BUG_ON(mapping->a_ops != &managed_cache_aops);
|
|
|
+ DBG_BUGON(!PageLocked(page));
|
|
|
+ DBG_BUGON(mapping->a_ops != &managed_cache_aops);
|
|
|
|
|
|
if (PagePrivate(page))
|
|
|
ret = erofs_try_to_free_cached_page(mapping, page);
|
|
|
@@ -279,10 +278,10 @@ static void managed_cache_invalidatepage(struct page *page,
|
|
|
{
|
|
|
const unsigned int stop = length + offset;
|
|
|
|
|
|
- BUG_ON(!PageLocked(page));
|
|
|
+ DBG_BUGON(!PageLocked(page));
|
|
|
|
|
|
- /* Check for overflow */
|
|
|
- BUG_ON(stop > PAGE_SIZE || stop < length);
|
|
|
+ /* Check for potential overflow in debug mode */
|
|
|
+ DBG_BUGON(stop > PAGE_SIZE || stop < length);
|
|
|
|
|
|
if (offset == 0 && stop == PAGE_SIZE)
|
|
|
while (!managed_cache_releasepage(page, GFP_NOFS))
|
|
|
@@ -619,7 +618,7 @@ static int erofs_show_options(struct seq_file *seq, struct dentry *root)
|
|
|
|
|
|
static int erofs_remount(struct super_block *sb, int *flags, char *data)
|
|
|
{
|
|
|
- BUG_ON(!sb_rdonly(sb));
|
|
|
+ DBG_BUGON(!sb_rdonly(sb));
|
|
|
|
|
|
*flags |= SB_RDONLY;
|
|
|
return 0;
|