opensubscriber
   Find in this group all groups
 
Linux-Kernel more information…

l : linux-kernel@vger.kernel.org 8 March 2005 • 1:05AM -0500

Re: [RFC] ext3/jbd race: releasing in-use journal_heads
by Stephen C. Tweedie

REPLY TO AUTHOR
 
REPLY TO GROUP




Hi,

On Mon, 2005-03-07 at 16:40, Stephen C. Tweedie wrote:

> Andrew, can you remember why we ended up with both of those locks in the
> first place?  If we can do it, the efficient way out here is to abandon
> the journal_head_lock and use the bh_state_lock for both.  We already
> hold that over many of the key refile spots, and this would avoid the
> need to take yet another lock in those paths.

Actually, I realised there's an easier way: provide a variant of
__journal_unfile_buffer() which doesn't clear jh->b_transaction.

That's a subtle change in the logic, but everywhere that is calling
this, we already hold various locks --- except for that elusive
bh_journal_head lock.

But since everywhere else is using _other_ locks, the transient state
where we're on the transaction but not on a list won't be visible ---
we'll have refiled before we drop the lock.

I think things should work just fine with this change.
__journal_unfile_buffer() already handles the case where we're called
with b_transaction set but no b_jlist, for example.

--Stephen


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

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.