2010-01-27 03:44:09

by Ding Dinghua

[permalink] [raw]
Subject: journal forget may introduce buffer aliasing problem?

Hi all:
The following is my analysis(if wrong, please point it out),
may be I can send a patch out if it's a bug.
If buffer_head belongs to comitting transaction,
jbd2_journal_forget do nothing except discard it from running
transaction. So this buffer will happily be inserted
into committing_transaction's checkpoint list and do write-back work,
then this buffer may be re-used as data-block, then there are two
buffer_heads maps to the same block, buffer aliasing occurs, and we
can't control the writeback order of the two buffer heads, fs may be
inconsistent.
The same thing will happen if buffer_head doesn't belongs to
running or committing transaction, but lays in checkpoint list.

--
??????


2010-01-27 05:58:55

by Ding Dinghua

[permalink] [raw]
Subject: Re: journal forget may introduce buffer aliasing problem?

Oops, I haven't seen unmap_underlying_metadata code in __block_prepare_write
so just forget this mail, sorry.

2010/1/27 ?????? <[email protected]>:
> Hi all:
> The following is my analysis(if wrong, please point it out),
> may be I can send a patch out if it's a bug.
> If buffer_head belongs to comitting transaction,
> jbd2_journal_forget do nothing except discard it from running
> transaction. So this buffer will happily be inserted
> into committing_transaction's checkpoint list and do write-back work,
> then this buffer may be re-used as data-block, then there are two
> buffer_heads maps to the same block, buffer aliasing occurs, and we
> can't control the writeback order of the two buffer heads, fs may be
> inconsistent.
> The same thing will happen if buffer_head doesn't belongs to
> running or committing transaction, but lays in checkpoint list.
>
> --
> ??????
>



--
??????