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

thin: check and use layered origin lv

Code needs to check if the layer origin device is suspended,
It's valid to create  thinvolume snapshot of thinvolume which is also
used as an old-style snapshot. In this case we need to check -real
is suspended.

When adding origin_only - add only layer thin volume.
(in case it's also old-snapshot add only -real device)
This commit is contained in:
Zdenek Kabelac 2013-07-15 11:47:10 +02:00
parent 925701d9f3
commit 97d36d5750
3 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.99 -
===================================
Properly use snapshot layer for origin which is also thin volume.
Avoid generating metadata backup when calling update_pool_lv().
Send thin messages also for active thin pool and inactive thin volume.
Add activation/auto_set_activation_skip to control activation skip flagging.

View File

@ -1681,7 +1681,7 @@ static int _add_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
return_0;
if (origin_only && lv_is_thin_volume(lv)) {
if (!_add_dev_to_dtree(dm, dtree, lv, NULL))
if (!_add_dev_to_dtree(dm, dtree, lv, lv_layer(lv)))
return_0;
#if 0
/* ? Use origin_only to avoid 'deep' thin pool suspend ? */

View File

@ -298,7 +298,7 @@ static int _thin_pool_add_target_line(struct dev_manager *dm,
case DM_THIN_MESSAGE_CREATE_THIN:
origin = first_seg(lmsg->u.lv)->origin;
/* Check if the origin is suspended */
if (origin && lv_info(cmd, origin, 0, &info, 0, 0) &&
if (origin && lv_info(cmd, origin, 1, &info, 0, 0) &&
info.exists && !info.suspended) {
/* Origin is not suspended, but the transaction may have been
* already transfered, so test for transaction_id and