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

This reverts commit b649934e08.

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: Ravi Kumar Siddojigari <rsiddoji@codeaurora.org>
This commit is contained in:
Ravi Kumar Siddojigari 2020-12-08 22:27:31 +05:30
commit 2a92b87a13

View file

@ -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;