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

lv_dependency: scan also snapshots and extorigins

When LV is scanned for its dependencies - scan also origin's snapshots,
and thin external origins.

So if any PV from snapshot or external origin device is missing - lvm2 will
avoid trying to activate such device.
This commit is contained in:
Zdenek Kabelac 2013-12-17 13:53:15 +01:00
parent 760714829b
commit 94137b72ed
2 changed files with 10 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.105 -
=====================================
Dependency scan counts with snapshots and external origins.
Make sure VG extent size is always greater or equal to PV phys. block size.
Optimize double call of stat() for cached devices.
Enable support for thin provisioning for default configuration.

View File

@ -2019,6 +2019,7 @@ static int _lv_each_dependency(struct logical_volume *lv,
{
unsigned i, s;
struct lv_segment *lvseg;
struct dm_list *snh;
struct logical_volume *deps[] = {
(lv->rdevice && lv != lv->rdevice->lv) ? lv->rdevice->lv : 0,
@ -2031,6 +2032,8 @@ static int _lv_each_dependency(struct logical_volume *lv,
}
dm_list_iterate_items(lvseg, &lv->segments) {
if (lvseg->external_lv && !fn(lvseg->external_lv, data))
return_0;
if (lvseg->log_lv && !fn(lvseg->log_lv, data))
return_0;
if (lvseg->rlog_lv && !fn(lvseg->rlog_lv, data))
@ -2044,6 +2047,12 @@ static int _lv_each_dependency(struct logical_volume *lv,
return_0;
}
}
if (lv_is_origin(lv))
dm_list_iterate(snh, &lv->snapshot_segs)
if (!fn(dm_list_struct_base(snh, struct lv_segment, origin_list)->cow, data))
return_0;
return 1;
}