From: Paul Taysom Date: Wed, 10 Apr 2013 17:03:40 +0000 (-0700) Subject: CHROMIUM: md: dm-verity fixed setting error_behavior X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=371b7f79fe7cc9590a8e1c4112ebcb3e690d9733;p=cascardo%2Flinux.git CHROMIUM: md: dm-verity fixed setting error_behavior 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 Change-Id: I32a516deb2bd564b599e73177e479cddec789dfb Reviewed-on: https://gerrit.chromium.org/gerrit/47744 Tested-by: Paul Taysom Reviewed-by: Mandeep Singh Baines Commit-Queue: Paul Taysom --- diff --git a/drivers/md/dm-verity.c b/drivers/md/dm-verity.c index 96e220d45ffe..0e48fbf5a674 100644 --- a/drivers/md/dm-verity.c +++ b/drivers/md/dm-verity.c @@ -916,7 +916,7 @@ static void pr_args(struct verity_args *args) 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, @@ -926,7 +926,8 @@ static void pr_args(struct verity_args *args) args->hash_start_block, args->algorithm, args->digest, - args->salt); + args->salt, + args->error_behavior); } /* @@ -1081,6 +1082,7 @@ static int verity_ctr(struct dm_target *ti, unsigned argc, char **argv) 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 @@ -1263,10 +1265,9 @@ static int verity_ctr(struct dm_target *ti, unsigned argc, char **argv) } /* 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;