master - activate: skip manual activation for --sysinit -aay
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=cd8ea8b437de53f0019bd69d542a7d01f3d5b7d3 Commit: cd8ea8b437de53f0019bd69d542a7d01f3d5b7d3 Parent: 8767435ef847831455fadc1f7e8f4d2d94aef0d5 Author: Peter Rajnoha <[email protected]> AuthorDate: Tue Jul 10 13:49:46 2012 +0200 Committer: Peter Rajnoha <[email protected]> CommitterDate: Tue Jul 10 14:01:33 2012 +0200
activate: skip manual activation for --sysinit -aay
When --sysinit -a ay is used with vg/lvchange and lvmetad is up and running, we should skip manual activation as that would be a useless step - all volumes are autoactivated once all the PVs for a VG are present.
If lvmetad is not active at the time of the vgchange --sysinit -a ay call, the activation proceeds in standard 'manual' way.
This way, we can still have vg/lvchange --sysinit -a ay called unconditionally in system initialization scripts no matter if lvmetad is used or not.
--- WHATS_NEW | 1 + man/lvchange.8.in | 5 +++++ man/vgchange.8.in | 5 +++++ tools/lvchange.c | 7 +++++++ tools/vgchange.c | 7 +++++++ 5 files changed, 25 insertions(+), 0 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.97 - =============================== + Skip activation when using vg/lvchange --sysinit -a ay and lvmetad is active. Fix extending RAID 4/5/6 logical volumes Fix test for PV with unknown VG in process_each_pv to ignore ignored mdas. Update man pages with --activate ay option and auto_activation_volume_list.
man/lvchange.8.in +5 -0
@@ -105,6 +105,11 @@ this is equivalent to using \fB\-\-ignorelockingfailure\fP, \fB\-\-ignoremonitoring\fP, \fB\-\-poll n\fP and setting \fBLVM_SUPPRESS_LOCKING_FAILURE_MESSAGES\fP environment variable. + +If \fB\-\-sysinit\fP is used in conjunction with lvmetad(8) enabled and running, +autoactivation is preferred over manual activation via direct lvchange call. +Logical volumes are autoactivated according to auto_activation_volume_list +set in lvm.conf(5). .TP .B \-\-noudevsync Disable udev synchronisation. The
man/vgchange.8.in +5 -0
@@ -121,6 +121,11 @@ this is equivalent to using .B \-\-poll n and setting \fBLVM_SUPPRESS_LOCKING_FAILURE_MESSAGES\fP environment variable. + +If \fB\-\-sysinit\fP is used in conjunction with lvmetad(8) enabled and running, +autoactivation is preferred over manual activation via direct vgchange call. +Logical volumes are autoactivated according to auto_activation_volume_list +set in lvm.conf(5). .TP .BR \-\-noudevsync Disable udev synchronisation. The
tools/lvchange.c +7 -0
@@ -798,6 +798,13 @@ int lvchange(struct cmd_context *cmd, int argc, char **argv)return EINVALID_CMD_LINE ; } +if (arg_count (cmd, sysinit_ARG) &&lvmetad_active () && +arg_uint_value (cmd, activate_ARG,0 ) ==CHANGE_AAY ) { +log_warn ("lvmetad is active while using --sysinit -a ay, " +"skipping manual activation" ); +return ECMD_PROCESSED ; + } +return process_each_lv (cmd, argc, argv, update ?READ_FOR_UPDATE :0 ,NULL , &lvchange_single);
tools/vgchange.c +7 -0
@@ -608,6 +608,13 @@ int vgchange(struct cmd_context *cmd, int argc, char **argv)return EINVALID_CMD_LINE ; } +if (arg_count (cmd, sysinit_ARG) &&lvmetad_active () && +arg_uint_value (cmd, activate_ARG,0 ) ==CHANGE_AAY ) { +log_warn ("lvmetad is active while using --sysinit -a ay, " +"skipping manual activation" ); +return ECMD_PROCESSED ; + } +return process_each_vg (cmd, argc, argv, update ?READ_FOR_UPDATE :0 ,NULL , &vgchange_single); }