mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-31 05:47:43 +03:00
validation: use validate_pool_chunk_size
We could validation pool chunk size with a single function.
This commit is contained in:
parent
6c44299006
commit
8d272ba0ad
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user