Re: [PATCH] Change ll_rw_block() calls in JBD

Stephen C. Tweedie
2006-05-19T15:05:49Z

Hi,

On Fri, 2006-05-19 at 14:33 +0200, Zoltan Menyhart wrote:

> > For two of the above comments: Under memory pressure data buffers can
> > be written out earlier and then released by __journal_try_to_free_buffer()
> > as they are not dirty any more. The above checks protect us against this.
>
> Assume "bh" has been set free in the mean time.
> Assume it is now used for another transaction (maybe for another file system).

I don't follow --- we already have a refcount to the bh, how can it be
reused? We took the j_list_lock first, then looked up the jh on this
transaction's sync data list, then did the get_bh() without dropping
j_list_lock; so by the time we take the refcount, the j_list_lock
ensures it cannot have come off this transaction. And subsequently, the
refcount prevents reuse.

--Stephen