1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib/locking
Jonathan Brassow abc89422af Mirror: Fix inability to remove VG's cluster flag if it contains a mirror
According to bug 995193, if a volume group
	1) contains a mirror
	2) is clustered
	3) 'locking_type' = 0 is used
then it is not possible to remove the 'c'luster flag from the VG.  This
is due to the way _lv_is_active behaves.

We shouldn't allow the cluster flag to be flipped unless the mirrors in
the cluster are not active.  This is because different kernel modules
are used depending on whether a mirror is cluster or not.  When we
attempt to see if the mirror is active, we first check locally.  If it
is not, then we attempt to check for remotely active instances if the VG
is clustered.  Since the no_lock locking type is LCK_CLUSTERED, but does
not implement 'query_resource', remote_lock_held will always return an
error in this case.  An error from remove_lock_held is treated as though
the lock _is_ held (i.e. the LV is active remotely).  This blocks the
cluster flag from changing.

The solution is to implement 'query_resource' for the no_lock type.  It
will report a message and return 1.  This will allow _lv_is_active to
function properly.  The LV would be considered not active remotely and
the VG can change its flag.
2013-08-12 13:56:47 -05:00
..
.exported_symbols Pre-release cleanups. 2009-05-21 03:04:52 +00:00
cluster_locking.c locking: fix cluster lock_resource fn prototype 2013-07-05 01:59:52 +01:00
external_locking.c config: add profile arg to find_config_tree_str 2013-07-02 15:19:09 +02:00
file_locking.c config: add profile arg to find_config_tree_bool 2013-07-02 15:19:09 +02:00
locking_types.h locking: Make it possible to pass down an LV to activation code. 2013-06-10 17:26:38 +02:00
locking.c locking: unlock memory on error path 2013-07-08 14:02:49 +02:00
locking.h locking: Make it possible to pass down an LV to activation code. 2013-06-10 17:26:38 +02:00
Makefile.in Install plugins to subdirs 2010-05-06 10:07:46 +00:00
no_locking.c Mirror: Fix inability to remove VG's cluster flag if it contains a mirror 2013-08-12 13:56:47 -05:00