Discussion:
[linux-lvm] Could we manually suspend the origin before taking dm-thin snapshots?
M.H. Tsai
2015-12-31 08:40:04 UTC
Permalink
Hi All,

I found an issue when taking dm-thin snapshots: LVM doesn't send
create_snap messages if the origin was already suspended, and LVM
doesn't report any error.

lvcreate vg1 --type thin --thinpool tp1 --virtualsize 1g
dmsetup suspend vg1-lv1
lvcreate vg1/lv1 --snapshot -an

This is due to commit a900d150 moves messaging from resume to suspend,
then LVM skips the suspend phase in this case. I'm not sure whether it
is a legal operation for LVM, but if LVM supports this feature, then
users can control the suspend timing.


Thanks,
Ming-Hung Tsai
Zdenek Kabelac
2015-12-31 21:12:47 UTC
Permalink
Post by M.H. Tsai
Hi All,
I found an issue when taking dm-thin snapshots: LVM doesn't send
create_snap messages if the origin was already suspended, and LVM
doesn't report any error.
lvcreate vg1 --type thin --thinpool tp1 --virtualsize 1g
dmsetup suspend vg1-lv1
lvcreate vg1/lv1 --snapshot -an
Hi

This is completely UNSUPPORTED - you MAY NOT interfere with
LV volumes with 'dmsetup'.

You can use dmsetup only if you know EXACTLY what's going on.
The only recommended usage of dmsetup with lvm2 is - when
lvm2 lacks some error path (e.g. fix mess left after
failing lvm command).

Otherwise there is no point to hijack LVs in the middle
of LV operations - i.e. in cluster world state of LV
(active/suspend) is tightly related to lock state.
Post by M.H. Tsai
This is due to commit a900d150 moves messaging from resume to suspend,
then LVM skips the suspend phase in this case. I'm not sure whether it
is a legal operation for LVM, but if LVM supports this feature, then
users can control the suspend timing.
plain unsupported state.

You could have been hijacking suspend/resume/remove operation
anytime. In fact you could easily block/freeze whole LV but doing
random suspends of DM devices in your system.

Regards

Zdenek

Loading...