ext4: fix data integrity for ext4_sync_fs
Inode's data or non journaled quota may be written w/o jounral so we _must_ send a barrier at the end of ext4_sync_fs. But it can be skipped if journal commit will do it for us. Also fix data integrity for nojournal mode. Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit is contained in:

committed by
Theodore Ts'o

parent
9ff8644624
commit
06a407f13d
@@ -1374,6 +1374,19 @@ static inline u32 jbd2_chksum(journal_t *journal, u32 crc,
|
||||
return *(u32 *)desc.ctx;
|
||||
}
|
||||
|
||||
/* Return most recent uncommitted transaction */
|
||||
static inline tid_t jbd2_get_latest_transaction(journal_t *journal)
|
||||
{
|
||||
tid_t tid;
|
||||
|
||||
read_lock(&journal->j_state_lock);
|
||||
tid = journal->j_commit_request;
|
||||
if (journal->j_running_transaction)
|
||||
tid = journal->j_running_transaction->t_tid;
|
||||
read_unlock(&journal->j_state_lock);
|
||||
return tid;
|
||||
}
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#define buffer_trace_init(bh) do {} while (0)
|
||||
|
Reference in New Issue
Block a user