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

Fix lv_is_visible to handle virtual origin.

Snapshot is visible if its origin is marked visible,
or if the origin is virtual.
This commit is contained in:
Milan Broz 2009-05-13 21:25:45 +00:00
parent 0b706ac672
commit b14c5af76d
2 changed files with 10 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.46 -
================================
Fix lv_is_visible to handle virtual origin.
Introduce link_lv_to_vg and unlink_lv_from_vg functions.
Remove lv_count from VG and use counter function instead.
Fix snapshot segment import to not use duplicate segments & replace.

View File

@ -30,8 +30,15 @@ int lv_is_cow(const struct logical_volume *lv)
int lv_is_visible(const struct logical_volume *lv)
{
if (lv_is_cow(lv))
return lv_is_visible(find_cow(lv)->lv);
if (lv->status & SNAPSHOT)
return 0;
if (lv_is_cow(lv)) {
if (lv_is_virtual_origin(origin_from_cow(lv)))
return 1;
return lv_is_visible(origin_from_cow(lv));
}
return lv->status & VISIBLE_LV ? 1 : 0;
}