Unverified Commit 262d7932 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!7069 ext4: fix uninitialized ratelimit_state->lock access in __ext4_fill_super()

parents 0f97a828 f3450e88
Loading
Loading
Loading
Loading
+10 −12
Original line number Diff line number Diff line
@@ -5633,19 +5633,15 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
	if (err)
		goto failed_mount6;

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

	err = ext4_init_orphan_info(sb);
	if (err)
		goto failed_mount8;
		goto failed_mount7;
#ifdef CONFIG_QUOTA
	/* Enable quota usage during mount. */
	if (ext4_has_feature_quota(sb) && !sb_rdonly(sb)) {
		err = ext4_enable_quotas(sb);
		if (err)
			goto failed_mount9;
			goto failed_mount8;
	}
#endif  /* CONFIG_QUOTA */

@@ -5671,7 +5667,7 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
		ext4_msg(sb, KERN_INFO, "recovery complete");
		err = ext4_mark_recovery_complete(sb, es);
		if (err)
			goto failed_mount10;
			goto failed_mount9;
	}

	if (test_opt(sb, DISCARD) && !bdev_max_discard_sectors(sb->s_bdev))
@@ -5688,15 +5684,17 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
	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;

	return 0;

failed_mount10:
failed_mount9:
	ext4_quotas_off(sb, EXT4_MAXQUOTAS);
failed_mount9: __maybe_unused
failed_mount8: __maybe_unused
	ext4_release_orphan_info(sb);
failed_mount8:
	ext4_unregister_sysfs(sb);
	kobject_put(&sbi->s_kobj);
failed_mount7:
	ext4_unregister_li_request(sb);
failed_mount6: