Description of problem: When using liblvm2app on a thin snapshot the following code causes a segfault: value = lvm_lv_get_property(lvmLV, "snap_percent"); Version-Release number of selected component (if applicable): LVM version: 2.02.98(2)-git (2012-08-24) Library version: 1.02.77-git (2012-08-24) Driver version: 4.22.0
Fix upstream (avoid detecting snap_percent on non-snap volume) https://www.redhat.com/archives/lvm-devel/2012-October/msg00026.html NB: thin snapshot doesn't have 'snap_percent' property - only 'data_percent' since thin_pool shares all the space between all its volume. Thus you could only obtain value of 'mapped' spaces (just like with any other thin volume).
Here is simple lvm2api test program which should pass now: ---- # Create pool & thin & snap LVs lvcreate -L5M -T vg/pool lvcreate -V1M -T vg/pool -n thin lvcreate -s vg/thin -n snap ---- #include "lvm2app.h" int main(int argc, char *argv[]) { lvm_t handle; vg_t vg; lv_t lv; struct lvm_property_value v; handle = lvm_init(NULL); vg = lvm_vg_open(handle, argv[1], "r", 0); lv = lvm_lv_from_name(vg, "snap"); v = lvm_lv_get_property(lv, "snap_percent"); lvm_vg_close(vg); lvm_quit(handle); return 0; }
Marking verified (Sanity Only), as snapshot testing of thin volumes is pretty solid in the latest rpms. 2.6.32-348.el6.x86_64 lvm2-2.02.98-6.el6 BUILT: Thu Dec 20 07:00:04 CST 2012 lvm2-libs-2.02.98-6.el6 BUILT: Thu Dec 20 07:00:04 CST 2012 lvm2-cluster-2.02.98-6.el6 BUILT: Thu Dec 20 07:00:04 CST 2012 udev-147-2.43.el6 BUILT: Thu Oct 11 05:59:38 CDT 2012 device-mapper-1.02.77-6.el6 BUILT: Thu Dec 20 07:00:04 CST 2012 device-mapper-libs-1.02.77-6.el6 BUILT: Thu Dec 20 07:00:04 CST 2012 device-mapper-event-1.02.77-6.el6 BUILT: Thu Dec 20 07:00:04 CST 2012 device-mapper-event-libs-1.02.77-6.el6 BUILT: Thu Dec 20 07:00:04 CST 2012 cmirror-2.02.98-6.el6 BUILT: Thu Dec 20 07:00:04 CST 2012
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2013-0501.html