Skip to content

Commit da0c5d2

Browse files
harshadjstytso
authored andcommitted
ext4: issue fsdev cache flush before starting fast commit
If the journal dev is different from fsdev, issue a cache flush before committing fast commit blocks to disk. Suggested-by: Jan Kara <jack@suse.cz> Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20201106035911.1942128-20-harshadshirwadkar@gmail.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent 556e031 commit da0c5d2

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

fs/ext4/fast_commit.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,13 @@ static int ext4_fc_perform_commit(journal_t *journal)
10071007
if (ret)
10081008
return ret;
10091009

1010+
/*
1011+
* If file system device is different from journal device, issue a cache
1012+
* flush before we start writing fast commit blocks.
1013+
*/
1014+
if (journal->j_fs_dev != journal->j_dev)
1015+
blkdev_issue_flush(journal->j_fs_dev, GFP_NOFS);
1016+
10101017
blk_start_plug(&plug);
10111018
if (sbi->s_fc_bytes == 0) {
10121019
/*

0 commit comments

Comments
 (0)