<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: Marcelo Tosatti &lt;marcelo.tosatti@cyclades.com&gt;

Gene is hitting this mapping-&gt;private_list corruption, with the BUG_ON's it
will be clearer what is happening in case others hit the same bug.

Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
---

 25-akpm/fs/buffer.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)

diff -puN fs/buffer.c~possible-dcache-bug-debugging-patch fs/buffer.c
--- 25/fs/buffer.c~possible-dcache-bug-debugging-patch	2004-09-11 17:26:14.416443064 -0700
+++ 25-akpm/fs/buffer.c	2004-09-11 17:26:14.421442304 -0700
@@ -794,6 +794,8 @@ EXPORT_SYMBOL(mark_buffer_async_write);
  */
 static inline void __remove_assoc_queue(struct buffer_head *bh)
 {
+	BUG_ON(bh-&gt;b_assoc_buffers.next == NULL);
+	BUG_ON(bh-&gt;b_assoc_buffers.prev == NULL);
 	list_del_init(&amp;bh-&gt;b_assoc_buffers);
 }
 
@@ -1068,7 +1070,10 @@ int remove_inode_buffers(struct inode *i
 
 		spin_lock(&amp;buffer_mapping-&gt;private_lock);
 		while (!list_empty(list)) {
-			struct buffer_head *bh = BH_ENTRY(list-&gt;next);
+			struct buffer_head *bh;
+
+			BUG_ON(list-&gt;next == NULL);
+			bh = BH_ENTRY(list-&gt;next);
 			if (buffer_dirty(bh)) {
 				ret = 0;
 				break;
_
</pre></body></html>