Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bff97255 authored by Gao Xiang's avatar Gao Xiang Committed by Greg Kroah-Hartman
Browse files

staging: erofs: unzip_vle_lz4.c,utils.c: rectify BUG_ONs



commit b8e076a6ef253e763bfdb81e5c72bcc828b0fbeb upstream.

remove all redundant BUG_ONs, and turn the rest
useful usages to DBG_BUGONs.

Signed-off-by: default avatarGao Xiang <gaoxiang25@huawei.com>
Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9a6a676e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ int z_erofs_vle_plain_copy(struct page **compressed_pages,
			if (compressed_pages[j] != page)
				continue;

			BUG_ON(mirrored[j]);
			DBG_BUGON(mirrored[j]);
			memcpy(percpu_data + j * PAGE_SIZE, dst, PAGE_SIZE);
			mirrored[j] = true;
			break;
+6 −6
Original line number Diff line number Diff line
@@ -23,9 +23,6 @@ struct page *erofs_allocpage(struct list_head *pool, gfp_t gfp)
		list_del(&page->lru);
	} else {
		page = alloc_pages(gfp | __GFP_NOFAIL, 0);

		BUG_ON(page == NULL);
		BUG_ON(page->mapping != NULL);
	}
	return page;
}
@@ -60,7 +57,7 @@ struct erofs_workgroup *erofs_find_workgroup(
		/* decrease refcount added by erofs_workgroup_put */
		if (unlikely(oldcount == 1))
			atomic_long_dec(&erofs_global_shrink_cnt);
		BUG_ON(index != grp->index);
		DBG_BUGON(index != grp->index);
	}
	rcu_read_unlock();
	return grp;
@@ -73,8 +70,11 @@ int erofs_register_workgroup(struct super_block *sb,
	struct erofs_sb_info *sbi;
	int err;

	/* grp->refcount should not < 1 */
	BUG_ON(!atomic_read(&grp->refcount));
	/* grp shouldn't be broken or used before */
	if (unlikely(atomic_read(&grp->refcount) != 1)) {
		DBG_BUGON(1);
		return -EINVAL;
	}

	err = radix_tree_preload(GFP_NOFS);
	if (err)