Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=26ead4bf45e94e6cfee203... Commit: 26ead4bf45e94e6cfee2036d1c0c800abf4344b3 Parent: 9dfb1a11b76282ed8f3819bf63c369b179fac78d Author: Zdenek Kabelac zkabelac@redhat.com AuthorDate: Fri Dec 21 20:55:50 2018 +0100 Committer: Zdenek Kabelac zkabelac@redhat.com CommitterDate: Fri Dec 21 21:45:08 2018 +0100
cov: extent_size cannot be 0
Make this obvious to coverity. --- lib/metadata/cache_manip.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/lib/metadata/cache_manip.c b/lib/metadata/cache_manip.c index 6cf945b..656e49d 100644 --- a/lib/metadata/cache_manip.c +++ b/lib/metadata/cache_manip.c @@ -1201,7 +1201,10 @@ int cache_single_set_params(struct cmd_context *cmd, * data size: the LV size minus the metadata size. */
- extent_size = pool_lv->vg->extent_size; + if (!(extent_size = pool_lv->vg->extent_size)) { + log_error(INTERNAL_ERROR "Extend size can't be 0."); + return 0; + } min_meta_size = extent_size; max_meta_size = 2 * DEFAULT_CACHE_POOL_MAX_METADATA_SIZE; /* 2x for KiB to sectors */
lvm2-commits@lists.fedorahosted.org