From 27ff8813da360da17c974f47e6e376fefddfd2f5 Mon Sep 17 00:00:00 2001 From: Jonathan Earl Brassow Date: Fri, 4 Feb 2011 20:30:17 +0000 Subject: Allow snapshots in a cluster as long as they are exclusively activated. In order to achieve this, we need to be able to query whether the origin is active exclusively (a condition of being able to add an exclusive snapshot). Once we are able to query the exclusive activation of an LV, we can safely create/activate the snapshot. A change to 'hold_lock' was also made so that a request to aquire a WRITE lock did not replace an EX lock, which is already a form of write lock. --- tools/vgchange.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tools/vgchange.c') diff --git a/tools/vgchange.c b/tools/vgchange.c index f2d399c4..4266d633 100644 --- a/tools/vgchange.c +++ b/tools/vgchange.c @@ -115,6 +115,16 @@ static int _activate_lvs_in_vg(struct cmd_context *cmd, ((lv->status & PVMOVE) )) continue; + /* + * If the LV is active exclusive remotely, + * then ignore it here + */ + if (lv_is_active_exclusive_remotely(lv)) { + log_verbose("%s/%s is exclusively active on" + " a remote node", vg->name, lv->name); + continue; + } + expected_count++; if (activate == CHANGE_AN) { -- cgit