static int _activate_lv_like_model(struct logical_volume *model,
struct logical_volume *lv)
{
+ /* FIXME: run all cases through lv_active_change when clvm variants are gone. */
+
+ if (is_lockd_type(lv->vg->lock_type))
+ return lv_active_change(lv->vg->cmd, lv, CHANGE_AEY, 0);
+
if (lv_is_active_exclusive(model)) {
if (!activate_lv_excl(lv->vg->cmd, lv))
return_0;
return 0;
}
+ if (!strcmp(lv->vg->lock_type, "dlm"))
+ new_lv->lock_args = lv->lock_args;
+
if (!dm_list_empty(&split_images)) {
/*
* A number of images have been split and
#include "activate.h"
#include "lv_alloc.h"
#include "lvm-string.h"
+#include "lvmlockd.h"
typedef int (*fn_on_lv_t)(struct logical_volume *lv, void *data);
static int _eliminate_extracted_lvs_optional_write_vg(struct volume_group *vg,
dm_list_init(&removal_lvs);
dm_list_init(&data_list);
- if (is_lockd_type(lv->vg->lock_type)) {
+ if (lv->vg->lock_type && !strcmp(lv->vg->lock_type, "sanlock")) {
log_error("Splitting raid image is not allowed with lock_type %s.",
lv->vg->lock_type);
return 0;
lvl->lv->name = split_name;
+ if (!strcmp(lv->vg->lock_type, "dlm"))
+ lvl->lv->lock_args = lv->lock_args;
+
if (!vg_write(lv->vg)) {
log_error("Failed to write changes for %s.",
display_lvname(lv));
* the original RAID LV having possibly had sub-LVs that have been
* shifted and renamed.
*/
- if (!activate_lv_excl_local(cmd, lvl->lv))
+
+ /* FIXME: run all cases through lv_active_change when clvm variants are gone. */
+
+ if (is_lockd_type(lvl->lv->vg->lock_type)) {
+ if (!lv_active_change(lv->vg->cmd, lvl->lv, CHANGE_AEY, 0))
+ return_0;
+ } else if (!activate_lv_excl_local(cmd, lvl->lv))
return_0;
dm_list_iterate_items(lvl, &removal_lvs)
int s;
struct lv_segment *seg = first_seg(lv);
- if (is_lockd_type(lv->vg->lock_type)) {
+ if (lv->vg->lock_type && !strcmp(lv->vg->lock_type, "sanlock")) {
log_error("Splitting raid image is not allowed with lock_type %s.",
lv->vg->lock_type);
return 0;
return 0;
}
+ /* Ensure primary LV is not active elsewhere. */
+ if (!lockd_lv(vg->cmd, lvl->lv, "ex", 0))
+ return_0;
+
lv = lvl->lv;
seg = first_seg(lv);
for (s = 0; s < seg->area_count; ++s)
*old_mimage_count = lv_mirror_count(lv);
*old_log_count = _get_log_count(lv);
- if (is_lockd_type(lv->vg->lock_type) && lp->keep_mimages) {
- /* FIXME: we need to create a lock for the new LV. */
+ if (lv->vg->lock_type && !strcmp(lv->vg->lock_type, "sanlock") && lp->keep_mimages) {
+ /* FIXME: we need to create a sanlock lock on disk for the new LV. */
log_error("Unable to split mirrors in VG with lock_type %s", lv->vg->lock_type);
return 0;
}