Commit 24fe7799 authored by Baokun Li's avatar Baokun Li
Browse files

Revert "ext4: drop read-only check from ext4_force_commit()"

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IBEQJ3



--------------------------------

This reverts commit 889860e4.

We are about to revert 95257987 ("ext4: drop EXT4_MF_FS_ABORTED flag"),
therefore the changes to the sb_rdonly check are being reverted here.

Fixes: 889860e4 ("ext4: drop read-only check from ext4_force_commit()")
Signed-off-by: default avatarBaokun Li <libaokun1@huawei.com>
parent e9c1b3c3
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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)