diff options
| author | Harshad Shirwadkar <[email protected]> | 2020-11-06 03:59:08 +0000 |
|---|---|---|
| committer | Theodore Ts'o <[email protected]> | 2020-11-07 04:01:05 +0000 |
| commit | da0c5d2695265962f20099737348fcb3ff524d0f (patch) | |
| tree | c8a3ab25c8b0d796a0832def3186d1c8e7cb0d3f /fs/ext4/fast_commit.c | |
| parent | ext4: disable fast commit with data journalling (diff) | |
| download | kernel-da0c5d2695265962f20099737348fcb3ff524d0f.tar.gz kernel-da0c5d2695265962f20099737348fcb3ff524d0f.zip | |
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 <[email protected]>
Signed-off-by: Harshad Shirwadkar <[email protected]>
Reviewed-by: Jan Kara <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Theodore Ts'o <[email protected]>
Diffstat (limited to 'fs/ext4/fast_commit.c')
| -rw-r--r-- | fs/ext4/fast_commit.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c index fb9b4e9d82b2..ebe5f423f8f2 100644 --- a/fs/ext4/fast_commit.c +++ b/fs/ext4/fast_commit.c @@ -1007,6 +1007,13 @@ static int ext4_fc_perform_commit(journal_t *journal) if (ret) return ret; + /* + * If file system device is different from journal device, issue a cache + * flush before we start writing fast commit blocks. + */ + if (journal->j_fs_dev != journal->j_dev) + blkdev_issue_flush(journal->j_fs_dev, GFP_NOFS); + blk_start_plug(&plug); if (sbi->s_fc_bytes == 0) { /* |
