diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2015-12-17 12:23:33 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2016-01-14 11:34:05 +0100 |
commit | 8857b227645e97b7cb52ae8d007e87e07db58b4e (patch) | |
tree | a1e631173774754241efd6cd0581966166c87664 /lib/cache_segtype | |
parent | 43897239b3cdd9ed9c1c7b795e171d9565d13116 (diff) | |
download | lvm2-8857b227645e97b7cb52ae8d007e87e07db58b4e.tar.gz |
segtype: check for activation
Before setting static variable with check passed state,
detect if we are allowed to talk to driver.
Diffstat (limited to 'lib/cache_segtype')
-rw-r--r-- | lib/cache_segtype/cache.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/cache_segtype/cache.c b/lib/cache_segtype/cache.c index 033cabe47..35d5e9344 100644 --- a/lib/cache_segtype/cache.c +++ b/lib/cache_segtype/cache.c @@ -224,20 +224,22 @@ static int _target_present(struct cmd_context *cmd, const struct dm_config_value *cv; const char *str; + if (!activation()) + return 0; + if (!_cache_checked) { - _cache_present = target_present(cmd, "cache", 1); + _cache_checked = 1; - if (!target_version("cache", &maj, &min, &patchlevel)) { - log_error("Failed to determine version of cache kernel module"); + if (!(_cache_present = target_present(cmd, "cache", 1))) return 0; - } - _cache_checked = 1; + if (!target_version("cache", &maj, &min, &patchlevel)) + return_0; if ((maj < 1) || ((maj == 1) && (min < 3))) { _cache_present = 0; - log_error("The cache kernel module is version %u.%u.%u. " + log_warn("WARNING: The cache kernel module is version %u.%u.%u. " "Version 1.3.0+ is required.", maj, min, patchlevel); return 0; |