mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-26 14:04:15 +03:00
a8921be641
Fix bug in table reload for clustered VG. Function used in lv/vgchange --monitor y|n is using 'somewhat' hackish shortcut and accesses activation function monitor_dev_for_events() directly rather through full device refresh to avoid table reload in case user want to only change monitoring state of device. However since with old 'mirrors' there is table change dropping handle_error there was in some cases needed table update. This was put into monitor_dev_for_events() with assumption vg_write_lock_held() could be used to decide if the actual monitoring change comes from read-only lock-holding commands lvchange/vgchange. However the clustered locking part (clvmd) actually doesn't differentiate about this concept of having VG openned in read-only or write mode. So it caused unwanted reloads of mirror tables even in commands like lvconvert. Thus for clustered locking there is full table reload put into the code and shortcut applies only for non-clustered locking. Also the patch tries to avoid calling repeated LV refresh in case the lv/vgchange uses --refresh & --monitor.