Re: [RFC] probably invalid accounting in jbd

Andrew Morton (akpm@digeo.com)
Fri, 23 May 2003 01:26:36 -0700


Alex Tomas <bzzz@tmi.comex.ru> wrote:
>
> I think current journal_release_buffer() which is used by ext3 allocator
> in -mm tree has a bug. look, it won't decrement credits if concurrent
> thread already put buffer on metadata list. but this may ext3_try_to_allocate()
> may overflow handle's credist.

Yes, that is so.

But some other handle has gained itself a free buffer. That is actually
harmless, except for one thing: as the handles are closed down,
->t_outstanding_credits will be too small. We could conceivably end up
overflowing the journal.

umm, one possible solution to that is to rework the t_outstanding_credits
logic so that we instead record:

number of buffers attached to the transaction +
sum of the initial size of all currently-running handles.

as each handle is closed off, we subtract its initial size from the above
metric. Any buffers which that handle happened to add to the lists would
have already been accounted for, when they were added.

I _think_ that'll work...

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/