]> git.karo-electronics.de Git - karo-tx-linux.git/commit
jbd: Write journal superblock with WRITE_FUA after checkpointing
authorJan Kara <jack@suse.cz>
Sat, 7 Apr 2012 09:05:19 +0000 (11:05 +0200)
committerJan Kara <jack@suse.cz>
Thu, 12 Apr 2012 15:20:37 +0000 (17:20 +0200)
commit77f0a97ef6ae75de993021f1139511beca7eaf23
treed26b1571725e9a65909c73e92923fce1f9c7cebd
parent34a7c01db30e52d19d1a433a60a68cce29638431
jbd: Write journal superblock with WRITE_FUA after checkpointing

If journal superblock is written only in disk's caches and other transaction
starts reusing space of the transaction cleaned from the log, it can happen
blocks of a new transaction reach the disk before journal superblock. When
power failure happens in such case, subsequent journal replay would still try
to replay the old transaction but some of it's blocks may be already
overwritten by the new transaction. For this reason we must use WRITE_FUA when
updating log tail and we must first write new log tail to disk and update
in-memory information only after that.

Signed-off-by: Jan Kara <jack@suse.cz>
fs/jbd/checkpoint.c
fs/jbd/commit.c
fs/jbd/journal.c
include/linux/jbd.h
include/trace/events/jbd.h