diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2020-01-06 15:57:08 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2020-01-13 17:42:31 +0100 |
commit | 5ccf3e6f30479331b9b47e0165ed191fbaa38f44 (patch) | |
tree | 4f3bd89c2eb17fd951fe123da9d10b3b9dffaccb | |
parent | 7737ffb11ceba0f4220e1dfb79b8e97f20e7b8e9 (diff) | |
download | lvm2-5ccf3e6f30479331b9b47e0165ed191fbaa38f44.tar.gz |
vdo: avoid running initialization of cache pool vars
Since VDO is also pool, the old if() case missed to know about this,
and executed unnecesserily initialization of cache pool variables.
This was usually harmless when using 'smaller' sizes of VDO pools,
but for big VDO pool size, we were reporting senseless messages
about big cache chunk sizes.
-rw-r--r-- | tools/lvcreate.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tools/lvcreate.c b/tools/lvcreate.c index 4a1534cc2..448f12588 100644 --- a/tools/lvcreate.c +++ b/tools/lvcreate.c @@ -396,13 +396,15 @@ static int _update_extents_params(struct volume_group *vg, &lp->discards, &lp->zero_new_blocks)) return_0; - } else if (!update_cache_pool_params(vg->cmd, vg->profile, vg->extent_size, - lp->segtype, lp->target_attr, - lp->extents, - &lp->pool_metadata_extents, - &lp->thin_chunk_size_calc_policy, - &lp->chunk_size)) - return_0; + } else if (segtype_is_cache_pool(lp->segtype) || segtype_is_cache(lp->segtype)) { + if (!update_cache_pool_params(vg->cmd, vg->profile, vg->extent_size, + lp->segtype, lp->target_attr, + lp->extents, + &lp->pool_metadata_extents, + &lp->thin_chunk_size_calc_policy, + &lp->chunk_size)) + return_0; + } if (lcp->percent == PERCENT_FREE || lcp->percent == PERCENT_PVS) { if (lp->extents <= (2 * lp->pool_metadata_extents)) { |