
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IBEQJ3 -------------------------------- This reverts commit 889860e452d7436ca72018b8a03cbd89c38d6384. We are about to revert 95257987a638 ("ext4: drop EXT4_MF_FS_ABORTED flag"), therefore the changes to the sb_rdonly check are being reverted here. Fixes: 889860e452d7 ("ext4: drop read-only check from ext4_force_commit()") Signed-off-by: Baokun Li <libaokun1@huawei.com> --- fs/ext4/super.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 92e3476d4fe0..0ce332f118d2 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -6436,7 +6436,13 @@ static int ext4_clear_journal_err(struct super_block *sb, */ int ext4_force_commit(struct super_block *sb) { - return ext4_journal_force_commit(EXT4_SB(sb)->s_journal); + journal_t *journal; + + if (sb_rdonly(sb)) + return 0; + + journal = EXT4_SB(sb)->s_journal; + return ext4_journal_force_commit(journal); } static int ext4_sync_fs(struct super_block *sb, int wait) -- 2.46.1