Jbd2 async problem

Rock Lee rockdotlee at gmail.com
Mon Jan 22 07:18:47 EST 2018


Hi:

I am working on jbd2 with checksum v3, trying to learn something from
the async feature. However, when I read the replay process in
do_one_process(), I got a little confused.

When async is on, commit blocks have the chance to reach the disk
before metadata blocks(which are on BJ_Shadow). If just at this
moment, power cutting occurs. Next mount time, we have to recovery
journal. Since checksum v3 is been chosen, metadata could be copyed to
filesystem one by one, if the metadata block has the right crc value.
But in the scenario I described before, commit block may reached disk
before some metadata blocks in a transaction. Current jbd2 code(linux
4.15) just skips those metadata blocks which have no correct crc, and
still copies the metadata blocks with the right crc.

I think in order to keep the consistency, the whole transaction should
be discarded, as long as not all the metadata blocks have the right
crc value in the transaction. But why jbd2 still copies the metadata
block(with the right crc) to filesystem when bad crc metadata blocks
exist ?

I will appreciate it if you could help me.

-- 
Cheers,
Rock



More information about the Kernelnewbies mailing list