Need to be able to set the error behavior from either the device table
or from the linux command line.
The code only handled setting from the linux command line which
broke the platform_DMVetiryCorruption test. This was not noticed
earlier because of another bug in error handling that was just
recently was fixed which exposed this problem.
Now the code defaults to the command line but overrides from
the device table.
BUG=chromium:229621
TEST=platform_DMVerityCorruption
Signed-off-by: Paul Taysom <taysom@chromium.org>
Change-Id: I32a516deb2bd564b599e73177e479cddec789dfb
Reviewed-on: https://gerrit.chromium.org/gerrit/47744
Tested-by: Paul Taysom <taysom@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Commit-Queue: Paul Taysom <taysom@chromium.org>
printk(KERN_INFO "VERITY args: version=%d data_device=%s hash_device=%s"
" data_block_size_bits=%d hash_block_size_bits=%d"
" num_data_blocks=%lld hash_start_block=%lld"
printk(KERN_INFO "VERITY args: version=%d data_device=%s hash_device=%s"
" data_block_size_bits=%d hash_block_size_bits=%d"
" num_data_blocks=%lld hash_start_block=%lld"
- " algorithm=%s digest=%s salt=%s\n",
+ " algorithm=%s digest=%s salt=%s error_behavior=%s\n",
args->version,
args->data_device,
args->hash_device,
args->version,
args->data_device,
args->hash_device,
args->hash_start_block,
args->algorithm,
args->digest,
args->hash_start_block,
args->algorithm,
args->digest,
+ args->salt,
+ args->error_behavior);
int i;
sector_t hash_position;
int i;
sector_t hash_position;
+ args.error_behavior = error_behavior;
if (argc == DM_VERITY_NUM_POSITIONAL_ARGS)
ti->error = positional_args(argc, argv, &args);
else
if (argc == DM_VERITY_NUM_POSITIONAL_ARGS)
ti->error = positional_args(argc, argv, &args);
else
}
/* chromeos allows setting error_behavior from both the module
}
/* chromeos allows setting error_behavior from both the module
- * parameters and the device args. However, chromeos only uses
- * the module parametres
+ * parameters and the device args.
- v->error_behavior = verity_parse_error_behavior(error_behavior);
+ v->error_behavior = verity_parse_error_behavior(args.error_behavior);
if (v->error_behavior == -1) {
ti->error = "Bad error_behavior supplied";
r = -EINVAL;
if (v->error_behavior == -1) {
ti->error = "Bad error_behavior supplied";
r = -EINVAL;