[linux-lvm] libdm cannot swap names between two child volumes
Zdenek Kabelac
zkabelac at redhat.com
Thu Jun 4 12:14:17 UTC 2015
Dne 4.6.2015 v 12:02 M.H. Tsai napsal(a):
> Hi All,
>
> I found that there's a potential bug in libdm when I try to swap sub
> volume's name. By executing the following code, the function
> dm_tree_activate_children() will go into infinite loop since that
> _rename_conflict_exists() still reports "resolvable=1" in this case.
>
> logical_volume *parent = ...;
> logical_volume *child1 = seg_lv(parent, 0);
> logical_volume *child2 = seg_lv(parent, 1);
> char const *tmp = child1->name;
> child1->name = child2->name;
> child2->name = tmp;
> resume_lv(cmd, parent);
>
> Although this scenario might not happen through command-line
> operation, some programmers might need this feature. I think that this
> issue could be resolve in libdm by assigning a temporary name, as the
> following patch does. Is it safe to do this?
Please provide sequence of 'ioctl' where you think there is a bug.
(or disclose your code using libdm).
There are many rules behind the work with subLV.
(e.g. you can't operate on subLV without operating through top level LV
(and yes some parts of lvm2 code are still buggy in this regard...))
Regards
Zdenek
More information about the linux-lvm
mailing list