Skip to contentSkip to conversation

staging: erofs: make use of DBG_BUGON

PATCH In review Hariprasad Kelam 3 participants 3 messages Jun 8, 2019 – Jun 11, 2019 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: erofs: make use of DBG_BUGON

DBG_BUGON is introduced and it could only crash when EROFS_FS_DEBUG (EROFS developping feature) is on.
replace BUG_ON with DBG_BUGON.

Signed-off-by Hariprasad Kelam <hariprasad.kelam at gmail.com>
---
 drivers/staging/erofs/unzip_vle.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/erofs/unzip_vle.h +3 -3
index 517e5ce..902e67d 100644
@@ -147,7 +147,7 @@ static inline unsigned z_erofs_onlinepage_index(struct page *page)
 {
 	union z_erofs_onlinepage_converter u;
 
-	BUG_ON(!PagePrivate(page));
+	DBG_BUGON(!PagePrivate(page));
 	u.v = &page_private(page);
 
 	return atomic_read(u.o) >> Z_EROFS_ONLINEPAGE_INDEX_SHIFT;
@@ -179,7 +179,7 @@ static inline void z_erofs_onlinepage_fixup(struct page *page,
 		if (!index)
 			return;
 
-		BUG_ON(id != index);
+		DBG_BUGON(id != index);
 	}
 
 	v = (index << Z_EROFS_ONLINEPAGE_INDEX_SHIFT) |
@@ -193,7 +193,7 @@ static inline void z_erofs_onlinepage_endio(struct page *page)
 	union z_erofs_onlinepage_converter u;
 	unsigned v;
 
-	BUG_ON(!PagePrivate(page));
+	DBG_BUGON(!PagePrivate(page));
 	u.v = &page_private(page);
 
 	v = atomic_dec_return(u.o);
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Hariprasad Kelam

DBG_BUGON is introduced and it could only crash when EROFS_FS_DEBUG (EROFS developping feature) is on.
replace BUG_ON with DBG_BUGON.

Signed-off-by Hariprasad Kelam <hariprasad.kelam at gmail.com>
Reviewed-by Gao Xiang <gaoxiang25 at huawei.com>

Thanks,
Gao Xiang

Quoted 36 lines
---
 drivers/staging/erofs/unzip_vle.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/erofs/unzip_vle.h +3 -3
index 517e5ce..902e67d 100644
@@ -147,7 +147,7 @@ static inline unsigned z_erofs_onlinepage_index(struct page *page)
 {
 	union z_erofs_onlinepage_converter u;
 
-	BUG_ON(!PagePrivate(page));
+	DBG_BUGON(!PagePrivate(page));
 	u.v = &page_private(page);
 
 	return atomic_read(u.o) >> Z_EROFS_ONLINEPAGE_INDEX_SHIFT;
@@ -179,7 +179,7 @@ static inline void z_erofs_onlinepage_fixup(struct page *page,
 		if (!index)
 			return;
 
-		BUG_ON(id != index);
+		DBG_BUGON(id != index);
 	}
 
 	v = (index << Z_EROFS_ONLINEPAGE_INDEX_SHIFT) |
@@ -193,7 +193,7 @@ static inline void z_erofs_onlinepage_endio(struct page *page)
 	union z_erofs_onlinepage_converter u;
 	unsigned v;
 
-	BUG_ON(!PagePrivate(page));
+	DBG_BUGON(!PagePrivate(page));
 	u.v = &page_private(page);
 
 	v = atomic_dec_return(u.o);
Reviewed-by on v1 1/1
#2 lore raw
In reply to Hariprasad Kelam
Quoted 5 lines · Hariprasad Kelam

DBG_BUGON is introduced and it could only crash when EROFS_FS_DEBUG (EROFS developping feature) is on.
replace BUG_ON with DBG_BUGON.

Signed-off-by Hariprasad Kelam <hariprasad.kelam at gmail.com>
Reviewed-by Chao Yu <yuchao0 at huawei.com>

Thanks,