From f74e8fe04471a44fe1ab0645e48c9cb06ef6fb4f Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Tue, 6 Aug 2013 16:28:12 +0200 Subject: [PATCH] thin: fix commit e195b5227e624cb125b070b4a10e24efdab16d53 Check chunk_size range unconditionally. --- lib/metadata/thin_manip.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/metadata/thin_manip.c b/lib/metadata/thin_manip.c index 36cd6c4d6..971ffe6d0 100644 --- a/lib/metadata/thin_manip.c +++ b/lib/metadata/thin_manip.c @@ -575,15 +575,15 @@ int update_profilable_pool_params(struct cmd_context *cmd, struct profile *profi { const char *dstr; - if (!(passed_args & PASS_ARG_CHUNK_SIZE)) { + if (!(passed_args & PASS_ARG_CHUNK_SIZE)) *chunk_size = find_config_tree_int(cmd, allocation_thin_pool_chunk_size_CFG, profile) * 2; - if ((*chunk_size < DM_THIN_MIN_DATA_BLOCK_SIZE) || - (*chunk_size > DM_THIN_MAX_DATA_BLOCK_SIZE)) { - log_error("Chunk size must be in the range %s to %s.", - display_size(cmd, DM_THIN_MIN_DATA_BLOCK_SIZE), - display_size(cmd, DM_THIN_MAX_DATA_BLOCK_SIZE)); - return 0; - } + + if ((*chunk_size < DM_THIN_MIN_DATA_BLOCK_SIZE) || + (*chunk_size > DM_THIN_MAX_DATA_BLOCK_SIZE)) { + log_error("Chunk size must be in the range %s to %s.", + display_size(cmd, DM_THIN_MIN_DATA_BLOCK_SIZE), + display_size(cmd, DM_THIN_MAX_DATA_BLOCK_SIZE)); + return 0; } if (!(passed_args & PASS_ARG_DISCARDS)) {