[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Bug in __invalidate_buffers?



Stephen,
I have come across what appears to be a bug in __invalidate_buffers()
w.r.t. the change in ext3-0.0.6 using BH_JDirty instead of BH_Dirty
for buffers held in the journal.  If invalidate_buffers() is called
on a device (LVM likes to do this a lot, for whatever reason), it yanks
JDirty buffers out from underneath the journal layer, and causes an
oops in journal_insert_checkpoint() (line 385, "buffer_dirty(bh) ||
buffer_jdirty()" is false).

I believe we need to add JDirty pages to those which are not flushed
when invalidate_buffers() is called (patch below).  However, what do we
do to prevent the oops when we are calling destroy_buffers()?  This
should only be called (from what the comments say) in the case of
removable media being removed while dirty buffers exist.  Maybe we
need to change the above assertion to journal abort?

Cheers, Andreas
==========================================================================
--- fs/buffer.c.orig	Wed Jan 17 03:22:54 2001
+++ fs/buffer.c	Thu Mar 29 01:34:21 2001
@@ -661,7 +661,8 @@
 				__wait_on_buffer(bh);
 			}
 			if (!bh->b_count &&
-			    (destroy_dirty_buffers || !buffer_dirty(bh)))
+			    (destroy_dirty_buffers ||
+			     (!buffer_dirty(bh) && !buffer_jdirty(bh)))
 				put_last_free(bh);
 			if (slept)
 				goto again;
-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]