master - cache: validate for locked
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6e57dbfcaa3fdc2aabe7c05f95268a35d6b198ca Commit: 6e57dbfcaa3fdc2aabe7c05f95268a35d6b198ca Parent: d4dab0aa34102527c32d68f69196aaabda5e3711 Author: Zdenek Kabelac <[email protected]> AuthorDate: Mon Oct 20 14:58:29 2014 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Fri Oct 24 16:39:31 2014 +0200
cache: validate for locked
Add extra safety.
--- WHATS_NEW | 1 + lib/metadata/cache_manip.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 0 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.112 - ===================================== + Add extra validate for locked lv within validate_lv_cache_create(). Add internal lvseg_name() function. Skip trying to file lock virtual internal vg name. Fix selection on {vg,lv}_permissions fields to properly match selection criteria.
lib/metadata/cache_manip.c +12 -0
@@ -104,6 +104,12 @@ int validate_lv_cache_create(const struct logical_volume *pool_lv,return 0 ; } +if (lv_is_locked (pool_lv)) { +log_error ("Cannot use locked cache pool %s." , +display_lvname (pool_lv)); +return 0 ; + } +if (origin_lv == pool_lv) {log_error ("Can't use same LV %s for cache pool and cache volume." ,display_lvname (pool_lv));
@@ -119,6 +125,12 @@ int validate_lv_cache_create(const struct logical_volume *pool_lv, } } +if (lv_is_locked (origin_lv)) { +log_error ("Cannot use locked origin volume %s." , +display_lvname (origin_lv)); +return 0 ; + } +/* For now we only support conversion of thin pool data volume */ if (!lv_is_visible (origin_lv) && !lv_is_thin_pool_data (origin_lv)) {log_error ("Can't convert internal LV %s." ,display_lvname (origin_lv));