From: Zdenek Kabelac <zkabelac@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH 13/25] Replicator: lock_vol update replicator LV
Date: Wed, 17 Mar 2010 15:28:12 +0100 [thread overview]
Message-ID: <4BA0E6FC.7060001@redhat.com> (raw)
In-Reply-To: <ac7a5396d35dce68e3f7c57b5238196d9e20fead.1268833246.git.zkabelac@redhat.com>
On 17.3.2010 14:47, Zdenek Kabelac wrote:
> Add LCK_MISSING_VG flag to sinal missing VG to _lock_vol function.
> This way we easily detect whether we still need to lock more VGs
> while having all data available - it would be ackware to resolve it
> from resource uuid string. In the case missing VG is found,
> whole whole operation must be retried - this usually requires to
> release all locks, and take them again in the alphabetic order.
>
> Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
> ---
> lib/locking/locking.c | 3 +++
> lib/locking/locking.h | 7 ++++++-
> 2 files changed, 9 insertions(+), 1 deletions(-)
>
> diff --git a/lib/locking/locking.c b/lib/locking/locking.c
> index 76dbda5..57b7ba9 100644
> --- a/lib/locking/locking.c
> +++ b/lib/locking/locking.c
> @@ -362,6 +362,9 @@ static int _lock_vol(struct cmd_context *cmd, const char *resource,
> {
> int ret = 0;
>
> + if (flags & LCK_MISSING_VG)
> + return_0;
> +
> _block_signals(flags);
> _lock_memory(cmd, lv_op);
>
> diff --git a/lib/locking/locking.h b/lib/locking/locking.h
> index e7f25b9..da442ec 100644
> --- a/lib/locking/locking.h
> +++ b/lib/locking/locking.h
> @@ -86,6 +86,7 @@ int check_lvm1_vg_inactive(struct cmd_context *cmd, const char *vgname);
> #define LCK_LOCAL 0x00000040U /* Don't propagate to other nodes */
> #define LCK_CLUSTER_VG 0x00000080U /* VG is clustered */
> #define LCK_CACHE 0x00000100U /* Operation on cache only using P_ lock */
> +#define LCK_MISSING_VG 0x00000200U /* 'Remote' VG misses lock for this LV */
>
> /*
> * Additional lock bits for cluster communication
> @@ -128,8 +129,12 @@ int check_lvm1_vg_inactive(struct cmd_context *cmd, const char *vgname);
> #define LCK_LV_CLUSTERED(lv) \
> (vg_is_clustered((lv)->vg) ? LCK_CLUSTER_VG : 0)
>
> +#define LCK_CHECK_MISSING_VG(lv) \
> + (lv_replicator_sites_check_vg((lv)) ? 0 : LCK_MISSING_VG)
> +
> #define lock_lv_vol(cmd, lv, flags) \
> - lock_vol(cmd, (lv)->lvid.s, flags | LCK_LV_CLUSTERED(lv))
> + lock_vol(cmd, (lv)->lvid.s, flags | LCK_LV_CLUSTERED(lv) | \
> + LCK_CHECK_MISSING_VG(lv))
>
> #define unlock_vg(cmd, vol) lock_vol(cmd, vol, LCK_VG_UNLOCK)
> #define unlock_and_release_vg(cmd, vg, vol) \
Here is simpler version which doesn't change LCK flags - so no changes in
clmvd....
Zdenek
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0018-Replicator-lock_vol-update-replicator-LV.patch
Type: text/x-patch
Size: 1041 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20100317/3a4accce/attachment.bin>
next prev parent reply other threads:[~2010-03-17 14:28 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-17 13:46 [PATCH 00/25] Replicator Zdenek Kabelac
2010-03-17 13:46 ` [PATCH 01/25] Remove const from volume_group* in process_each Zdenek Kabelac
2010-03-18 13:39 ` Alasdair G Kergon
2010-03-17 13:46 ` [PATCH 02/25] Replicator: add libdm support Zdenek Kabelac
2010-03-17 13:46 ` [PATCH 03/25] Replicator: suspend/deactivate replicator Zdenek Kabelac
2010-03-17 13:46 ` [PATCH 04/25] Replicator: add lvm support Zdenek Kabelac
2010-03-17 13:46 ` [PATCH 05/25] Replicator: validate replicator segments Zdenek Kabelac
2010-03-17 13:46 ` [PATCH 06/25] Replicator: extend _lv_each_dependency() rep. deps Zdenek Kabelac
2010-03-17 13:47 ` [PATCH 07/25] Replicator: extend VG with list of opened vgs Zdenek Kabelac
2010-03-17 13:47 ` [PATCH 08/25] Replicator: add sorted vg_name_list Zdenek Kabelac
2010-03-17 13:47 ` [PATCH 09/25] Replicator: add lv_replicator_sites_check_vg Zdenek Kabelac
2010-03-17 13:47 ` [PATCH 10/25] Replicator: add read/release VG for rsites Zdenek Kabelac
2010-03-17 13:47 ` [PATCH 11/25] Replicator: use vg_name_list for _process_one_vg() Zdenek Kabelac
2010-03-17 13:47 ` [PATCH 12/25] Replicator: use str_list for process_each_lv_in_vg Zdenek Kabelac
2010-03-17 13:47 ` [PATCH 13/25] Replicator: lock_vol update replicator LV Zdenek Kabelac
2010-03-17 14:28 ` Zdenek Kabelac [this message]
2010-03-17 13:47 ` [PATCH 14/25] Replicator: extend activate with rsite resolving Zdenek Kabelac
2010-03-17 13:47 ` [PATCH 15/25] Replicator: update _create_partial_dtree() Zdenek Kabelac
2010-03-17 13:47 ` [PATCH 16/25] Replicator: vg with missing_vgs does not print Zdenek Kabelac
2010-03-17 13:47 ` [PATCH 17/25] Replicator: add replicator to dtree Zdenek Kabelac
2010-03-17 13:47 ` [PATCH 18/25] Replicator: do not remove of replicators' LVs Zdenek Kabelac
2010-03-17 13:47 ` [PATCH 19/25] Replicator: no crash lvresize if area_count is 0 Zdenek Kabelac
2010-03-18 13:44 ` Alasdair G Kergon
2010-03-17 13:47 ` [PATCH 20/25] Replicator: activate change for vgchange Zdenek Kabelac
2010-03-17 13:47 ` [PATCH 21/25] Replicator: add new options for replicator Zdenek Kabelac
2010-03-17 13:47 ` [PATCH 22/25] Replicator: man pages for lvcreate, lvchange Zdenek Kabelac
2010-03-17 13:47 ` [PATCH 23/25] Replicator: update copyright dates Zdenek Kabelac
2010-03-17 13:47 ` [PATCH 24/25] Replicator: update generated lib/misc/configure.h.in Zdenek Kabelac
2010-03-17 13:47 ` [PATCH 25/25] Replicator: update generated configure.in Zdenek Kabelac
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BA0E6FC.7060001@redhat.com \
--to=zkabelac@redhat.com \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.