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:
parent
0b706ac672
commit
b14c5af76d
@ -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.
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user