[Ocfs2-commits] mfasheh commits r1395 - trunk/src
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Fri Aug 27 18:37:37 CDT 2004
Author: mfasheh
Date: 2004-08-27 18:37:36 -0500 (Fri, 27 Aug 2004)
New Revision: 1395
Modified:
trunk/src/Makefile
trunk/src/buffer_head_io.c
Log:
* some debugging code to catch races with our I/O and our journalling.
Modified: trunk/src/Makefile
===================================================================
--- trunk/src/Makefile 2004-08-27 23:18:26 UTC (rev 1394)
+++ trunk/src/Makefile 2004-08-27 23:37:36 UTC (rev 1395)
@@ -22,6 +22,7 @@
endif
GLOBAL_DEFINES =
+GLOBAL_DEFINES += -DCATCH_BH_JBD_RACES
#GLOBAL_DEFINES += -DPURE_EVIL
ifdef OCFS_DEBUG
Modified: trunk/src/buffer_head_io.c
===================================================================
--- trunk/src/buffer_head_io.c 2004-08-27 23:18:26 UTC (rev 1394)
+++ trunk/src/buffer_head_io.c 2004-08-27 23:37:36 UTC (rev 1395)
@@ -135,6 +135,17 @@
}
lock_buffer(bh);
+ if (!(flags & OCFS_BH_IGNORE_JBD) && buffer_jbd(bh)) {
+#ifdef CATCH_BH_JBD_RACES
+ printk("Ugh, 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
+ }
set_buffer_uptodate(bh);
/* remove from dirty list before I/O. */
@@ -275,6 +286,17 @@
}
lock_buffer(bh);
+ if (buffer_jbd(bh)) {
+#ifdef CATCH_BH_JBD_RACES
+ printk("Ugh, 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);
bh->b_end_io = ocfs_end_buffer_io_sync;
if (flags & OCFS_BH_READAHEAD)
More information about the Ocfs2-commits
mailing list