[Ocfs2-commits] mfasheh commits r811 - trunk/patches
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Wed Mar 24 19:46:36 CST 2004
Author: mfasheh
Date: 2004-03-24 19:46:34 -0600 (Wed, 24 Mar 2004)
New Revision: 811
Added:
trunk/patches/journal_create_buffer_fix.patch
Log:
Add a patch from Sonic Zhang <sonic.zhang at intel.com> which fixes a
warning seen during mount on a 2.6 kernel.
Added: trunk/patches/journal_create_buffer_fix.patch
===================================================================
--- trunk/patches/journal_create_buffer_fix.patch 2004-03-24 22:49:08 UTC (rev 810)
+++ trunk/patches/journal_create_buffer_fix.patch 2004-03-25 01:46:34 UTC (rev 811)
@@ -0,0 +1,70 @@
+Hi Stephen,
+
+I found a bug in JBD routine journal_create() in kernel 2.6, when I debug
+the OCFS v2 driver. mark_buffer_dirty() reports buffer_head is not
+uptodate. See following bug description.
+
+-------------------------------------------------------
+
+OS: Linux Kernel 2.6.1
+Plarform: IA32
+
+Steps:
+1. Build the ocfs v2 driver under kernel 2.6.
+2. insert ocfs2.ko into kernel 2.6.
+3. mkfs.ocfs2 -F -b 4 -l testocfs -m /mnt/ocfs2 /dev/hdb2
+4. mount -t ocfs2 /dev/hdb2 /mnt/ocfs2
+
+Results:
+buffer layer error at fs/buffer.c:1266
+Call Trace:
+[<>] mark_buffer_dirty
+[<>] journal_create
+[<>] ocfs_journal_create
+[<>] ocfs_check_volume
+[<>] ocfs_mount_volume
+......
+
+-------------------------------------------------------
+
+I think I found the root cause of the bug reported in mark_buffer_dirty().
+
+It is caused in the Linux journaling routine(JBD) journal_create(). In
+kernel 2.6.x, buffer_head state BH_Uptodate is checked in mark_buffer_dirty(),
+while kernel 2.4.x doesn't do. If this state doesn't exist in the buffer_head,
+buffer error information is reported. But, in routine journal_create(), the state
+BH_Uptodate is set after the call to mark_buffer_dirty(). This works well in
+kernel 2.4.x, but fails in kernel 2.6.x.
+
+I attach a patch to fix this bug in kernel 2.6.x. Please check if it works well in
+kernel 2.6.x.
+
+-------------------------------------------------------
+
+--- linux-2.6.4a/fs/jbd/journal.c 2004-03-19 10:40:49.264613984 +0800
++++ linux-2.6.4/fs/jbd/journal.c 2004-03-19 10:41:12.091143824 +0800
+@@ -832,10 +832,10 @@
+ bh = __getblk(journal->j_dev, blocknr, journal->j_blocksize);
+ lock_buffer(bh);
+ memset (bh->b_data, 0, journal->j_blocksize);
+- BUFFER_TRACE(bh, "marking dirty");
+- mark_buffer_dirty(bh);
+ BUFFER_TRACE(bh, "marking uptodate");
+ set_buffer_uptodate(bh);
++ BUFFER_TRACE(bh, "marking dirty");
++ mark_buffer_dirty(bh);
+ unlock_buffer(bh);
+ __brelse(bh);
+ }
+
+
+
+--Sonic Zhang
+
+
+
+
+_______________________________________________
+Ocfs2-devel mailing list
+Ocfs2-devel at oss.oracle.com
+http://oss.oracle.com/mailman/listinfo/ocfs2-devel
More information about the Ocfs2-commits
mailing list