Skip to contentSkip to conversation

ocfs2: disable BUG assertions in reading blocks

PATCH Applied Gang He 1 participant 1 message Jun 22, 2016 OCFS2

lore
Share & tools
lore

Gang He

author
#0 lore raw

PATCH 1/1 ocfs2: disable BUG assertions in reading blocks

According to some high-load testing, these two BUG assertions were encountered, this led system panic. Actually, there were some discussions about removing these two BUG() assertions, it would not bring any side effect.
Then, I did the the following changes,
1) use the existing macro CATCH_BH_JBD_RACES to wrap BUG() in the ocfs2_read_blocks_sync function like before.
2) disable the macro CATCH_BH_JBD_RACES in Makefile by default.

---
 fs/ocfs2/Makefile         | 2 --
 fs/ocfs2/buffer_head_io.c | 5 +++++
 2 files changed, 5 insertions(+), 2 deletions(-)
fs/ocfs2/Makefile +0 -2
index e27e652..4342c7e 100644
@@ -1,7 +1,5 @@
 ccflags-y := -Ifs/ocfs2
 
-ccflags-y += -DCATCH_BH_JBD_RACES
-
 obj-$(CONFIG_OCFS2_FS) += 	\
 	ocfs2.o			\
 	ocfs2_stackglue.o
fs/ocfs2/buffer_head_io.c +5 -0
index fe50ded..498641e 100644
@@ -139,11 +139,16 @@ int ocfs2_read_blocks_sync(struct ocfs2_super *osb, u64 block,
 
 		lock_buffer(bh);
 		if (buffer_jbd(bh)) {
+#ifdef CATCH_BH_JBD_RACES
 			mlog(ML_ERROR,
 			     "block %llu had the JBD bit set "
 			     "while I was in lock_buffer!",
 			     (unsigned long long)bh->b_blocknr);
 			BUG();
+#else
+			unlock_buffer(bh);
+			continue;
+#endif
 		}
 
 		clear_buffer_uptodate(bh);
Signature · 1 line
1.8.5.6