1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

lvcreate: fix activation of cached LV

Since LV for caching can be already a stacked LV, proper activation
needs to use lock holding LV.
This commit is contained in:
Zdenek Kabelac 2018-03-05 12:54:39 +01:00
parent b2f1254c14
commit 23de09aeb8
2 changed files with 3 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.178 - Version 2.02.178 -
===================================== =====================================
Activate correct lock holding LV when it is cached.
Do not modify archived metadata when removing striped raid. Do not modify archived metadata when removing striped raid.
Fix memleak on error path when obtaining lv_raid_data_offset. Fix memleak on error path when obtaining lv_raid_data_offset.
Fix compatibility size test of extended external origin. Fix compatibility size test of extended external origin.

View File

@ -1222,6 +1222,8 @@ static int _determine_cache_argument(struct volume_group *vg,
return_0; /* FIXME */ return_0; /* FIXME */
/* Put origin into resulting activation state first */ /* Put origin into resulting activation state first */
lv = (struct logical_volume *)lv_lock_holder(lv);
if (is_change_activating(lp->activate)) { if (is_change_activating(lp->activate)) {
if ((lp->activate == CHANGE_AAY) && if ((lp->activate == CHANGE_AAY) &&
!lv_passes_auto_activation_filter(cmd, lv)) { !lv_passes_auto_activation_filter(cmd, lv)) {