master - validation: use validate_pool_chunk_size
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8d272ba0ada6deae264e44705a4ce3b7ece93cd0 Commit: 8d272ba0ada6deae264e44705a4ce3b7ece93cd0 Parent: 6c4429900645959966784dd0f0045ec0c4f6233f Author: Zdenek Kabelac <[email protected]> AuthorDate: Mon Oct 6 11:54:25 2014 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Mon Oct 6 15:23:07 2014 +0200
validation: use validate_pool_chunk_size
We could validation pool chunk size with a single function.
--- lib/metadata/merge.c | 10 +++------- 1 files changed, 3 insertions(+), 7 deletions(-)
lib/metadata/merge.c +3 -7
@@ -224,13 +224,9 @@ int check_lv_segments(struct logical_volume *lv, int complete_vg) inc_error_count; } -if ((seg_is_thin_pool (seg) && - ((seg->chunk_size <DM_THIN_MIN_DATA_BLOCK_SIZE ) || - (seg->chunk_size >DM_THIN_MAX_DATA_BLOCK_SIZE ))) || - (seg_is_cache_pool (seg) && - ((seg->chunk_size <DM_CACHE_MIN_DATA_BLOCK_SIZE ) || - (seg->chunk_size >DM_CACHE_MAX_DATA_BLOCK_SIZE )))) { -log_error ("LV %s: %s segment %u has chunk size %u out of range." , +if (seg_is_pool (seg) && + !validate_pool_chunk_size (lv->vg->cmd, seg->segtype, seg->chunk_size)) { +log_error ("LV %s: %s segment %u has invalid chunk size %u." , lv->name, seg->segtype->name, seg_count, seg->chunk_size); inc_error_count; }