1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

thin: report pool as holder when no active thin volume

In the case there is no active thin volume, report thin pool
as lock holder. This fixed function like lvextend
which either expecte lock holder LV is some active thin
or 'possibly' inactive thin pool.
This commit is contained in:
Zdenek Kabelac 2016-09-16 21:47:57 +02:00
parent c26cd48536
commit 776d5a25b4
2 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.166 - Version 2.02.166 -
===================================== =====================================
Fix lock-holder device for thin pool with inactive thin volumes.
Use --alloc normal for mirror logs even if the mimages were stricter. Use --alloc normal for mirror logs even if the mimages were stricter.
Use O_DIRECT to gather metadata in lvmdump. Use O_DIRECT to gather metadata in lvmdump.
Fix possible NULL pointer derefence when checking for monitoring. Fix possible NULL pointer derefence when checking for monitoring.

View File

@ -1547,7 +1547,7 @@ const struct logical_volume *lv_lock_holder(const struct logical_volume *lv)
if (lv_is_cow(lv)) if (lv_is_cow(lv))
return lv_lock_holder(origin_from_cow(lv)); return lv_lock_holder(origin_from_cow(lv));
if (lv_is_thin_pool(lv)) if (lv_is_thin_pool(lv)) {
/* Find any active LV from the pool */ /* Find any active LV from the pool */
dm_list_iterate_items(sl, &lv->segs_using_this_lv) dm_list_iterate_items(sl, &lv->segs_using_this_lv)
if (lv_is_active(sl->seg->lv)) { if (lv_is_active(sl->seg->lv)) {
@ -1555,6 +1555,8 @@ const struct logical_volume *lv_lock_holder(const struct logical_volume *lv)
display_lvname(lv)); display_lvname(lv));
return sl->seg->lv; return sl->seg->lv;
} }
return lv;
}
/* RAID changes visibility of splitted LVs but references them still as leg/meta */ /* RAID changes visibility of splitted LVs but references them still as leg/meta */
if ((lv_is_raid_image(lv) || lv_is_raid_metadata(lv)) && lv_is_visible(lv)) if ((lv_is_raid_image(lv) || lv_is_raid_metadata(lv)) && lv_is_visible(lv))