Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a92b87a authored by Ravi Kumar Siddojigari's avatar Ravi Kumar Siddojigari
Browse files

Revert "dm verity: correcting logic used with corrupted_errs counter"



This reverts commit b649934e.

Based on the upstream review comments its not advised to
ignore the block error and continue so reverting this .

Change-Id: Icf18bd5bdba96b396eee3ddff7e6d39a9bed5816
Signed-off-by: default avatarRavi Kumar Siddojigari <rsiddoji@codeaurora.org>
parent 33569a19
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -220,10 +220,8 @@ static int verity_handle_err(struct dm_verity *v, enum verity_block_type type,
	/* Corruption should be visible in device status in all modes */
	v->hash_failed = 1;

	if (v->corrupted_errs >= DM_VERITY_MAX_CORRUPTED_ERRS) {
		DMERR("%s: reached maximum errors", v->data_dev->name);
	if (v->corrupted_errs >= DM_VERITY_MAX_CORRUPTED_ERRS)
		goto out;
	}

	v->corrupted_errs++;

@@ -241,16 +239,14 @@ static int verity_handle_err(struct dm_verity *v, enum verity_block_type type,
	DMERR_LIMIT("%s: %s block %llu is corrupted", v->data_dev->name,
		    type_str, block);

	if (v->corrupted_errs == DM_VERITY_MAX_CORRUPTED_ERRS)
		DMERR("%s: reached maximum errors", v->data_dev->name);

	snprintf(verity_env, DM_VERITY_ENV_LENGTH, "%s=%d,%llu",
		DM_VERITY_ENV_VAR_NAME, type, block);

	kobject_uevent_env(&disk_to_dev(dm_disk(md))->kobj, KOBJ_CHANGE, envp);

	/* corrupted_errs count had not reached limits */
	return 0;


out:
	if (v->mode == DM_VERITY_MODE_LOGGING)
		return 0;