Unverified Commit 937925af authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!3797 [sync] PR-3771: ext4: fix uninitialized ratelimit_state->lock access in __ext4_fill_super()

parents 2f6f863e fc9803c9
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
@@ -5132,10 +5132,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
	if (err)
		goto failed_mount6;

	err = ext4_register_sysfs(sb);
	if (err)
		goto failed_mount7;

#ifdef CONFIG_QUOTA
	/* Enable quota usage during mount. */
	if (ext4_has_feature_quota(sb) && !sb_rdonly(sb)) {
@@ -5168,7 +5164,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
		ext4_msg(sb, KERN_INFO, "recovery complete");
		err = ext4_mark_recovery_complete(sb, es);
		if (err)
			goto failed_mount10;
			goto failed_mount9;
	}
	if (EXT4_SB(sb)->s_journal) {
		if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA)
@@ -5205,6 +5201,11 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
	atomic_set(&sbi->s_warning_count, 0);
	atomic_set(&sbi->s_msg_count, 0);

	/* Register sysfs after all initializations are complete. */
	err = ext4_register_sysfs(sb);
	if (err)
		goto failed_mount9;

	kfree(orig_data);
	return 0;

@@ -5213,12 +5214,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
		ext4_msg(sb, KERN_ERR, "VFS: Can't find ext4 filesystem");
	goto failed_mount;

failed_mount10:
failed_mount9:
	ext4_quota_off_umount(sb);
failed_mount8: __maybe_unused
	ext4_unregister_sysfs(sb);
	kobject_put(&sbi->s_kobj);
failed_mount7:
	ext4_unregister_li_request(sb);
failed_mount6:
	ext4_mb_release(sb);