mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
1ce8486dcc
commit
fd2cbd4dfa
5 changed files with 65 additions and 39 deletions
|
@ -864,7 +864,8 @@ extern int journal_destroy (journal_t *);
|
|||
extern int journal_recover (journal_t *journal);
|
||||
extern int journal_wipe (journal_t *, int);
|
||||
extern int journal_skip_recovery (journal_t *);
|
||||
extern void journal_update_sb_log_tail (journal_t *);
|
||||
extern void journal_update_sb_log_tail (journal_t *, tid_t, unsigned int,
|
||||
int);
|
||||
extern void journal_abort (journal_t *, int);
|
||||
extern int journal_errno (journal_t *);
|
||||
extern void journal_ack_err (journal_t *);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue