mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
activation: lv_activation_skip remove always same arg.
Remove 'skip' argument passed into the function. We always used '0' - as this is the only supported option (-K) and there is no complementary option. Also add some testing for behaviour of skipping.
This commit is contained in:
parent
750a310a40
commit
c71a3bcbc0
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.106 -
|
Version 2.02.106 -
|
||||||
====================================
|
====================================
|
||||||
|
Remove (always 0) skip argument from lv_activation_skip().
|
||||||
Create /dev/disk/by-id/lvm-pv-uuid-<PV_UUID> symlink for each PV via udev.
|
Create /dev/disk/by-id/lvm-pv-uuid-<PV_UUID> symlink for each PV via udev.
|
||||||
lvcreate computes RAID4/5/6 stripes if not given from # of allocatable PVs.
|
lvcreate computes RAID4/5/6 stripes if not given from # of allocatable PVs.
|
||||||
Fix merging of old snapshot into thin volume origin.
|
Fix merging of old snapshot into thin volume origin.
|
||||||
|
@ -5673,11 +5673,11 @@ void lv_set_activation_skip(struct logical_volume *lv, int override_default,
|
|||||||
* of the 'skip' arg supplied instead.
|
* of the 'skip' arg supplied instead.
|
||||||
*/
|
*/
|
||||||
int lv_activation_skip(struct logical_volume *lv, activation_change_t activate,
|
int lv_activation_skip(struct logical_volume *lv, activation_change_t activate,
|
||||||
int override_lv_skip_flag, int skip)
|
int override_lv_skip_flag)
|
||||||
{
|
{
|
||||||
if (!(lv->status & LV_ACTIVATION_SKIP) ||
|
if (!(lv->status & LV_ACTIVATION_SKIP) ||
|
||||||
!is_change_activating(activate) || /* Do not skip deactivation */
|
!is_change_activating(activate) || /* Do not skip deactivation */
|
||||||
(override_lv_skip_flag && !skip))
|
override_lv_skip_flag)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
log_verbose("ACTIVATON_SKIP flag set for LV %s/%s, skipping activation.",
|
log_verbose("ACTIVATON_SKIP flag set for LV %s/%s, skipping activation.",
|
||||||
@ -6244,11 +6244,8 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
|
|||||||
lp->activate = lv_passes_auto_activation_filter(cmd, lv) ?
|
lp->activate = lv_passes_auto_activation_filter(cmd, lv) ?
|
||||||
CHANGE_ALY : CHANGE_ALN;
|
CHANGE_ALY : CHANGE_ALN;
|
||||||
|
|
||||||
if (lv_activation_skip(lv, lp->activate, lp->activation_skip & ACTIVATION_SKIP_IGNORE, 0)) {
|
if (lv_activation_skip(lv, lp->activate, lp->activation_skip & ACTIVATION_SKIP_IGNORE))
|
||||||
log_verbose("ACTIVATION_SKIP flag set for LV %s/%s, skipping activation.",
|
|
||||||
lv->vg->name, lv->name);
|
|
||||||
lp->activate = CHANGE_AN;
|
lp->activate = CHANGE_AN;
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For thin pools - deactivate when inactive pool is requested or
|
* For thin pools - deactivate when inactive pool is requested or
|
||||||
|
@ -832,7 +832,7 @@ struct logical_volume *lv_create_single(struct volume_group *vg,
|
|||||||
*/
|
*/
|
||||||
void lv_set_activation_skip(struct logical_volume *lv, int override_default, int add_skip_flag);
|
void lv_set_activation_skip(struct logical_volume *lv, int override_default, int add_skip_flag);
|
||||||
int lv_activation_skip(struct logical_volume *lv, activation_change_t activate,
|
int lv_activation_skip(struct logical_volume *lv, activation_change_t activate,
|
||||||
int override_lv_skip_flag, int skip);
|
int override_lv_skip_flag);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Functions for layer manipulation
|
* Functions for layer manipulation
|
||||||
|
32
test/shell/activation-skip.sh
Normal file
32
test/shell/activation-skip.sh
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Copyright (C) 2014 Red Hat, Inc. All rights reserved.
|
||||||
|
#
|
||||||
|
# This copyrighted material is made available to anyone wishing to use,
|
||||||
|
# modify, copy, or redistribute it subject to the terms and conditions
|
||||||
|
# of the GNU General Public License v.2.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
|
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
. lib/test
|
||||||
|
|
||||||
|
# Test skip activation flag -k|--setactivationskip
|
||||||
|
|
||||||
|
aux prepare_vg
|
||||||
|
|
||||||
|
lvcreate -an --zero n -l 1 -n $lv1 $vg
|
||||||
|
lvcreate -ky -K -l1 -n $lv2 $vg
|
||||||
|
get lv_field $vg/$lv2 lv_attr | grep -- "-wi-a----k"
|
||||||
|
|
||||||
|
lvchange -ay -K $vg
|
||||||
|
check active $vg $lv1
|
||||||
|
lvchange -an $vg
|
||||||
|
|
||||||
|
lvchange -ay --setactivationskip y $vg/$lv1
|
||||||
|
check inactive $vg $lv1
|
||||||
|
|
||||||
|
get lv_field $vg/$lv1 lv_attr | grep -- "-wi------k"
|
||||||
|
|
||||||
|
lvchange -ay -K $vg
|
||||||
|
check active $vg $lv1
|
@ -215,7 +215,7 @@ static int _lvchange_activate(struct cmd_context *cmd, struct logical_volume *lv
|
|||||||
|
|
||||||
activate = (activation_change_t) arg_uint_value(cmd, activate_ARG, CHANGE_AY);
|
activate = (activation_change_t) arg_uint_value(cmd, activate_ARG, CHANGE_AY);
|
||||||
|
|
||||||
if (lv_activation_skip(lv, activate, arg_count(cmd, ignoreactivationskip_ARG), 0))
|
if (lv_activation_skip(lv, activate, arg_count(cmd, ignoreactivationskip_ARG)))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (lv_is_cow(lv) && !lv_is_virtual_origin(origin_from_cow(lv)))
|
if (lv_is_cow(lv) && !lv_is_virtual_origin(origin_from_cow(lv)))
|
||||||
|
@ -120,7 +120,7 @@ static int _activate_lvs_in_vg(struct cmd_context *cmd, struct volume_group *vg,
|
|||||||
if ((lv->status & PVMOVE) && !is_change_activating(activate))
|
if ((lv->status & PVMOVE) && !is_change_activating(activate))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (lv_activation_skip(lv, activate, arg_count(cmd, ignoreactivationskip_ARG), 0))
|
if (lv_activation_skip(lv, activate, arg_count(cmd, ignoreactivationskip_ARG)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ((activate == CHANGE_AAY) &&
|
if ((activate == CHANGE_AAY) &&
|
||||||
|
Loading…
Reference in New Issue
Block a user