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

Re: Bug in __invalidate_buffers?

Stephen writes:
> Just been traveling for work, and I'm currently on holiday.  Right at
> this moment I'm taking a train from New Orleans to Los Angeles (nearly
> 48 hours on the train --- we're stopped in El Paso as I write this!).  

Yes, this is why trains are not as popular in Canada and the USA as they
are in Europe.

> > Anyhow, the below patch has fixed the invalidate_buffers() causing oops
> > problem for me (running LVM pvscan while writing into an ext3-0.0.6b fs).
> I'd much rather fix the buffer.c code.  Having journaling try to patch
> up after somebody has deleted its buffer heads is very wrong, since we
> risk the buffer journal lists getting badly corrupted if we allow
> those buffers to be reused.

> Does the patch below (untested, uncompiled!) work?

OK, I've applied the patch (removing my old check for buffer_jdirty()),
but leaving in the checks in jfs/commit.c for B_FREE buffer heads.  This
should tell me right away if there are still buffers being freed from
underneath the journal, without oopsing my machine all the time.

> Eventually I'll be keeping an elevated b_count on _all_ buffers with
> any journal metadata at all (as a side effect of separating that
> metadata out into a separate journal_head struct), so this sort of
> problem will just go away.  Nobody touches buffer_heads with non-zero
> b_count.

Yes, this is what I was originally thinking the problem was - we were
not keeping a reference on a journaled buffer, but then I also was
thinking that for metadata-only journaling it was OK if a buffer is
flushed to disk and freed if we are under memory pressure.  Otherwise,
we block up to journal_size buffers, even for metadata-only journaling.

Cheers, Andreas
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]