Re: [Ext2-devel] [PATCH] JBD: journal_release_buffer()

From: Stephen C. Tweedie
Date: Mon Jan 24 2005 - 18:44:30 EST


Hi,

On Mon, 2005-01-24 at 22:24, Alex Tomas wrote:
> hmmm. that's a good catch. so, with this patch A increments h_buffer_credits
> and this one will go to the t_outstanding_credits while the buffer is still
> part of the transaction. indeed, an imbalance.
>
> probably something like the following would be enough?
>
> + /* return credit back to the handle if it was really spent */
> + if (credits) {
> + handle->h_buffer_credits++;
> + spin_lock(&handle->h_transaction->t_handle_lock);
> + handle->h_transaction->t_outstanding_credits++;
> + spin_lock(&handle->h_transaction->t_handle_lock);
> + }

That returns the credit to A (satisfying ext3), but you just grew
t_outstanding_credits, thus growing the journal commitments without
checking if it's safe to do so or being able to handle failure. So it
just reintroduces the original bug.

--Stephen

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