]> sourceware.org Git - lvm2.git/log
lvm2.git
9 years agodevices: avoid extra open() syscall
Zdenek Kabelac [Tue, 3 Mar 2015 14:37:17 +0000 (15:37 +0100)]
devices: avoid extra open() syscall

If the device is already opened by lvm's device cache,
avoid extra syscall opening devices for obtaining its size.

9 years agoman: add info to lvmsystemid
David Teigland [Thu, 5 Mar 2015 18:12:42 +0000 (12:12 -0600)]
man: add info to lvmsystemid

about losing access to a VG if lvm is downgraded
to an earlier version.

9 years agosystem_id: avoid munging vg and lv fields
David Teigland [Thu, 5 Mar 2015 16:23:16 +0000 (10:23 -0600)]
system_id: avoid munging vg and lv fields

Munge the WRITE/WRITE_LOCKED flags in a temp variable
instead of in the vg/lv fields.

9 years agosystem_id: undo the previous changes to the lvm1 code
David Teigland [Thu, 5 Mar 2015 16:13:05 +0000 (10:13 -0600)]
system_id: undo the previous changes to the lvm1 code

The system_id and lock_type compat changes do not apply
to the lvm1 code.

9 years agosystem_id: make new VGs read-only for old lvm versions
David Teigland [Wed, 4 Mar 2015 17:30:53 +0000 (11:30 -0600)]
system_id: make new VGs read-only for old lvm versions

Previous versions of lvm will not obey the restrictions
imposed by the new system_id, and would allow such a VG
to be written.  So, a VG with a new system_id is further
changed to force previous lvm versions to treat it as
read-only.  This is done by removing the WRITE flag from
the metadata status line of these VGs, and putting a new
WRITE_LOCKED flag in the flags line of the metadata.

Versions of lvm that recognize WRITE_LOCKED, also obey the
new system_id.  For these lvm versions, WRITE_LOCKED is
identical to WRITE, and the rules associated with matching
system_id's are imposed.

A new VG lock_type field is also added that causes the same
WRITE/WRITE_LOCKED transformation when set.  A previous
version of lvm will also see a VG with lock_type as read-only.

Versions of lvm that recognize WRITE_LOCKED, must also obey
the lock_type setting.  Until the lock_type feature is added,
lvm will fail to read any VG with lock_type set and report an
error about an unsupported lock_type.  Once the lock_type
feature is added, lvm will allow VGs with lock_type to be
used according to the rules imposed by the lock_type.

When both system_id and lock_type settings are removed, a VG
is written with the old WRITE status flag, and without the
new WRITE_LOCKED flag.  This allows old versions of lvm to
use the VG as before.

9 years agoRevert "systemid: Add ACCESS_NEEDS_SYSTEM_ID VG flag."
David Teigland [Wed, 4 Mar 2015 17:11:10 +0000 (11:11 -0600)]
Revert "systemid: Add ACCESS_NEEDS_SYSTEM_ID VG flag."

This reverts commit bfbb5d269aa1ed56d9308117b57d4d2da49d53f6.

This will be done differently.

9 years agosystem_id: enable the options in config file and command line
David Teigland [Wed, 4 Mar 2015 17:15:45 +0000 (11:15 -0600)]
system_id: enable the options in config file and command line

9 years agoreport: fix seg_monitor field to display monitoring status for thick snapshots and...
Peter Rajnoha [Thu, 5 Mar 2015 09:45:29 +0000 (10:45 +0100)]
report: fix seg_monitor field to display monitoring status for thick snapshots and mirrors

The seg_monitor did not display monitored status for thick snapshots
and mirrors (with mirror log *not* mirrored). The seg monitor did work
correctly even before for other segtypes - thins and raids.

Before (mirrors and snapshots, only mirrors with mirrored log properly displayed monitoring status):

[0] f21/~ # lvs -a -o lv_name,lv_layout,lv_role,seg_monitor vg
  LV                                     Layout     Role                             Monitor
  mirror                                 mirror     public
  [mirror_mimage_0]                      linear     private,mirror,image
  [mirror_mimage_1]                      linear     private,mirror,image
  [mirror_mlog]                          linear     private,mirror,log

  mirror_with_mirror_log                 mirror     public                           monitored
  [mirror_with_mirror_log_mimage_0]      linear     private,mirror,image
  [mirror_with_mirror_log_mimage_1]      linear     private,mirror,image
  [mirror_with_mirror_log_mlog]          mirror     private,mirror,log               monitored
  [mirror_with_mirror_log_mlog_mimage_0] linear     private,mirror,image
  [mirror_with_mirror_log_mlog_mimage_1] linear     private,mirror,image

  thick_origin                           linear     public,origin,thickorigin
  thick_snapshot                         linear     public,snapshot,thicksnapshot

With this patch applied (monitoring status displayed for all mirrors and snapshots):

[0] f21/~ # lvs -a -o lv_name,lv_layout,lv_role,seg_monitor vg
  LV                                     Layout     Role                             Monitor
  mirror                                 mirror     public                           monitored
  [mirror_mimage_0]                      linear     private,mirror,image
  [mirror_mimage_1]                      linear     private,mirror,image
  [mirror_mlog]                          linear     private,mirror,log

  mirror_with_mirror_log                 mirror     public                           monitored
  [mirror_with_mirror_log_mimage_0]      linear     private,mirror,image
  [mirror_with_mirror_log_mimage_1]      linear     private,mirror,image
  [mirror_with_mirror_log_mlog]          mirror     private,mirror,log               monitored
  [mirror_with_mirror_log_mlog_mimage_0] linear     private,mirror,image
  [mirror_with_mirror_log_mlog_mimage_1] linear     private,mirror,image

  thick_origin                           linear     public,origin,thickorigin
  thick_snapshot                         linear     public,snapshot,thicksnapshot    monitored

9 years agopost-release
Alasdair G Kergon [Wed, 4 Mar 2015 14:00:46 +0000 (14:00 +0000)]
post-release

9 years agopre-release v2_02_117
Alasdair G Kergon [Wed, 4 Mar 2015 13:49:51 +0000 (13:49 +0000)]
pre-release

9 years agocleanup: tools: "or use -S for selection" --> "or use --select for selection"
Peter Rajnoha [Wed, 4 Mar 2015 13:40:04 +0000 (14:40 +0100)]
cleanup: tools: "or use -S for selection" --> "or use --select for selection"

9 years agosystemid: Disable --systemid.
Alasdair G Kergon [Wed, 4 Mar 2015 13:14:51 +0000 (13:14 +0000)]
systemid: Disable --systemid.

Disable use of --systemid for this release.

9 years agoconfig: add CFG_DISABLED flag and mark system_id settings with that flag
Peter Rajnoha [Wed, 4 Mar 2015 13:08:47 +0000 (14:08 +0100)]
config: add CFG_DISABLED flag and mark system_id settings with that flag

If configuration setting is marked in config_setting.h with CFG_DISABLED
flag, default value is always used for such setting, no matter if it's defined
by user (in --config/lvm.conf/lvmlocal.conf).

A warning message is displayed if this happens:

For example:

[1] f21/~ # lvm dumpconfig --validate
  WARNING: Configuration setting global/system_id_source is disabled. Using default value.
  LVM configuration valid.

[1] f21/~ # pvs
  WARNING: Configuration setting global/system_id_source is disabled. Using default value.
  PV         VG     Fmt  Attr PSize   PFree
  /dev/sdb          lvm2 ---  128.00m 128.00m
  ...

9 years agovgremove: select: direct selection to be done per-VG, not per-LV
Peter Rajnoha [Wed, 4 Mar 2015 09:44:31 +0000 (10:44 +0100)]
vgremove: select: direct selection to be done per-VG, not per-LV

Though vgremove operates per VG by definition, internally, it
actually means iterating over each LV it contains to do the
remove.

So we need to direct selection a bit in this case so that the
selection is done per-VG, not per-LV.

That means, use processing handle with void_handle.internal_report_for_select=0
for the process_each_lv_in_vg that is called later in vgremove_single fn.
We need to disable internal selection for process_each_lv_in_vg
here as selection is already done by process_each_vg which calls
vgremove_single. Otherwise selection would be done per-LV and not
per-VG as we intend!

An intra-release fix for commit 00744b053f395be79ab1cb80fdf7342548aa79e2.

9 years agosystemid: Add ACCESS_NEEDS_SYSTEM_ID VG flag.
Alasdair G Kergon [Wed, 4 Mar 2015 01:16:32 +0000 (01:16 +0000)]
systemid: Add ACCESS_NEEDS_SYSTEM_ID VG flag.

Set ACCESS_NEEDS_SYSTEM_ID VG status flag whenever there is
a non-lvm1 system_id set.  Prevents concurrent access from
older LVM2 versions.
Not set on VGs that bear a system_id only due to conversion
from lvm1 metadata.

9 years agosystemid: Init and merge lvm2 and lvm1 fields.
Alasdair G Kergon [Wed, 4 Mar 2015 01:00:51 +0000 (01:00 +0000)]
systemid: Init and merge lvm2 and lvm1 fields.

Use system_id field in preference to lvm1_system_id.
Initialise both for now.

9 years agovgchange: Prevent lvm1 system ID changes.
Alasdair G Kergon [Wed, 4 Mar 2015 00:50:54 +0000 (00:50 +0000)]
vgchange: Prevent lvm1 system ID changes.

(This system_id setting code shouldn't be in two places.)

9 years agoformat1: Export generate_lvm1_system_id.
Alasdair G Kergon [Wed, 4 Mar 2015 00:44:15 +0000 (00:44 +0000)]
format1: Export generate_lvm1_system_id.

Export _lvm1_system_id as generate_lvm1_system_id and call it in
vg_setup() so it is set before writing the metadata to disk
and not missing from the initial metadata backup file.

9 years agoarchives: Preserve format type in file.
Alasdair G Kergon [Wed, 4 Mar 2015 00:30:26 +0000 (00:30 +0000)]
archives: Preserve format type in file.

format_text processes both lvm2 on-disk metadata and metadata read
from other sources such as backup files.  Add original_fmt field
to retain the format type of the original metadata.
Before this patch, /etc/lvm/archives would contain backups of
lvm1 metadata with format = "lvm2" unless the source was lvm1 on-disk
metadata.

9 years agolvchange, vgchange: fix the system_id check
David Teigland [Tue, 3 Mar 2015 22:45:16 +0000 (16:45 -0600)]
lvchange, vgchange: fix the system_id check

The check for matching system_id needs to check
that the system_id is not blank.

9 years agovgchange: deactivate LVs in foreign VG
David Teigland [Tue, 3 Mar 2015 19:23:13 +0000 (13:23 -0600)]
vgchange: deactivate LVs in foreign VG

Apply the same logic as lvchange, which allows
deactivating LVs in a foreign VG.

9 years agospec: Add lvmlocal.conf to RPMs.
Petr Rockai [Tue, 3 Mar 2015 14:45:47 +0000 (15:45 +0100)]
spec: Add lvmlocal.conf to RPMs.

9 years agometadata: vg: alloc lvm1_system_id in alloc_vg sooner
Peter Rajnoha [Mon, 2 Mar 2015 12:00:37 +0000 (13:00 +0100)]
metadata: vg: alloc lvm1_system_id in alloc_vg sooner

9 years agometadata: vg: add missing vg->lvm1_system_id initialization
Peter Rajnoha [Mon, 2 Mar 2015 11:16:55 +0000 (12:16 +0100)]
metadata: vg: add missing vg->lvm1_system_id initialization

The vg->lvm1_systemd_id needs to be initialized as all the code around
counts with that. Just like we initialize lvm1_system_id in vg_create
(no matter if it's actually LVM1 or LVM2 format), this patch adds this
init in alloc_vg as well so the rest of the code does not segfaul
 when trying to access vg->lvm1_system_id.

9 years agoreport: check value of args_are_pvs, not the pointer (fix for commit 9ea77b7)
Peter Rajnoha [Mon, 2 Mar 2015 09:36:32 +0000 (10:36 +0100)]
report: check value of args_are_pvs, not the pointer (fix for commit 9ea77b7)

9 years agosystem_id: apply consistent naming
David Teigland [Fri, 27 Feb 2015 19:32:00 +0000 (13:32 -0600)]
system_id: apply consistent naming

In log messages refer to it as system ID (not System ID).

Do not put quotes around the system_id string when printing.

On the command line use systemid.

In code, metadata, and config files use system_id.

In lvmsystemid refer to the concept/entity as system_id.

9 years agoinitscripts: lvm2-monitor: use @DMEVENTD_PIDFILE@ instead of hardcoded /var/run/dmeve...
Peter Rajnoha [Fri, 27 Feb 2015 14:48:10 +0000 (15:48 +0100)]
initscripts: lvm2-monitor: use @DMEVENTD_PIDFILE@ instead of hardcoded /var/run/dmeventd.pid

9 years agoinitscripts: lvm2-monitor: implement status action
Jose Castillo [Fri, 27 Feb 2015 14:38:34 +0000 (15:38 +0100)]
initscripts: lvm2-monitor: implement status action

Two new functions added in the init script: rh_status and rh_status_q.
First one to be used in status() and second one to be used in start(),
stop(), force_stop(). Check for 'dmeventd' added and print list of
lvs being monitored in status().

9 years agocleanup: change check order in condition in _check_pv_list fn
Peter Rajnoha [Fri, 27 Feb 2015 13:52:31 +0000 (14:52 +0100)]
cleanup: change check order in condition in _check_pv_list fn

"!dev_cache_get(argv[i], cmd->full_filter) && !rescan_done" --> "!rescan_done && !dev_cache_get(argv[i], cmd->full_filter)

Check the simple condition first (variable), then the function return value
(which in this case certainly takes more time to evaluate) - save some time.

9 years agolvchange: Allow -pr to change kernel only.
Alasdair G Kergon [Fri, 27 Feb 2015 13:38:26 +0000 (13:38 +0000)]
lvchange: Allow -pr to change kernel only.

9 years agoreport: one more comment explaining change of report type when tags are used for...
Peter Rajnoha [Fri, 27 Feb 2015 12:48:47 +0000 (13:48 +0100)]
report: one more comment explaining change of report type when tags are used for original LABEL reporting

9 years agoreport: fix handling of reports with pure label fields
Peter Rajnoha [Fri, 27 Feb 2015 12:32:52 +0000 (13:32 +0100)]
report: fix handling of reports with pure label fields

Two problems fixed by this patch:
  - PV tags were not recognized at all when using them with pvs
    report that has only label fields (regression since 2.02.105)
  - incorrect persistent .cache file to be generated after pvs
    report that has only label fields (regression since 2.02.106)

These bugs come from the transition from process_each_pv to
process_each_label introduced by commit
67a7b7a87da65b2350f975272e581be5f41976e0 and commit
490226fc475232e0b158cf9fdc8670a663da4efe and related.

9 years agoconf: be more clear about wipe_signatures_when_zeroing_new_lvs option in comments
Peter Rajnoha [Fri, 27 Feb 2015 07:53:15 +0000 (08:53 +0100)]
conf: be more clear about wipe_signatures_when_zeroing_new_lvs option in comments

9 years agosystem_id: remove unwanted foreign error for some commands
David Teigland [Thu, 26 Feb 2015 22:06:32 +0000 (16:06 -0600)]
system_id: remove unwanted foreign error for some commands

Commands that can never use foreign VGs begin with
cmd->error_foreign_vgs = 1.  This tells the vg_read
lib layer to print an error as soon as a foreign VG
is read.

The toollib process_each layer also prints an error if a
foreign VG is read, but is more selective about it.  It
won't print an error if the command did not explicitly
name the foreign VG.  We want to silently ignore foreign VGs
unless a command attempts to use one explicitly.

So, foreign VG errors are printed from two different layers:
vg_read (lower layer) and process_each (upper layer).

Commands that use toollib process_each, only want errors from
the process_each layer, not from both layers.  So, process_each
disables the lower layer vg_read error message by setting
error_foreign_vgs = 0.

Commands that do not use toollib process_each, want errors
from the vg_read layer, otherwise they would get no error
message.  The original cmd->error_foreign_vgs setting
enables this error.

(Commands that are allowed to operate on foreign VGs always
begin with cmd->error_foreign_vgs = 0, and all the commands
in this group use toollib process_each with the selective
error reporting.)

9 years agomirror: Explicit cast in region_size_max
Alasdair G Kergon [Thu, 26 Feb 2015 19:49:25 +0000 (19:49 +0000)]
mirror: Explicit cast in region_size_max

9 years agomirror: Avoid region size compiler warning.
Alasdair G Kergon [Thu, 26 Feb 2015 19:45:55 +0000 (19:45 +0000)]
mirror: Avoid region size compiler warning.

format ‘%u’ expects type ‘unsigned int’, but argument 7 has type ‘uint64_t’

9 years agotests: more system_id tests
David Teigland [Thu, 26 Feb 2015 19:22:47 +0000 (13:22 -0600)]
tests: more system_id tests

9 years agolvchange: Allow -prw to change kernel only.
Alasdair G Kergon [Thu, 26 Feb 2015 18:38:26 +0000 (18:38 +0000)]
lvchange: Allow -prw to change kernel only.

If an LV is already rw but still ro in the kernel, allow -prw to issue a
refresh to try to change the kernel state to rw.

Intended for use after clearing activation/read_only_volume_list in
lvm.conf.

9 years agoman: lvmsystemid: empty string equals no system_id
David Teigland [Wed, 25 Feb 2015 22:55:56 +0000 (16:55 -0600)]
man: lvmsystemid: empty string equals no system_id

9 years agotests: add more system_id tests
David Teigland [Wed, 25 Feb 2015 22:13:28 +0000 (16:13 -0600)]
tests: add more system_id tests

9 years agopvscan, vgscan: include foreign vgs with --cache
David Teigland [Wed, 25 Feb 2015 21:41:15 +0000 (15:41 -0600)]
pvscan, vgscan: include foreign vgs with --cache

pvscan --cache and vgscan --cache scan devices to refresh lvmetad,
and they should also refresh the lvmetad copy of foreign vgs.

9 years agoWHATS_NEW: vgimport with lvmetad
David Teigland [Wed, 25 Feb 2015 18:30:00 +0000 (12:30 -0600)]
WHATS_NEW: vgimport with lvmetad

9 years agotests: fix the system_id tests
David Teigland [Wed, 25 Feb 2015 18:27:49 +0000 (12:27 -0600)]
tests: fix the system_id tests

That were broken by yesterday's system_id changes.

9 years agotests: add more systemid tests
David Teigland [Wed, 25 Feb 2015 18:23:34 +0000 (12:23 -0600)]
tests: add more systemid tests

9 years agolvchange: deactivate is always possible in foreign vgs
David Teigland [Wed, 25 Feb 2015 17:33:11 +0000 (11:33 -0600)]
lvchange: deactivate is always possible in foreign vgs

The only realistic way for a host to have active LVs in a
foreign VG is if the host's system_id (or system_id_source)
is changed while LVs are active.

In this case, the active LVs produce an warning, and access
to the VG is implicitly allowed (without requiring --foreign.)
This allows the active LVs to be deactivated.

In this case, rescanning PVs for the VG offers no benefit.
It is not possible that rescanning would reveal an LV that
is active but wasn't previously in the VG metadata.

9 years agocmirror: Adjust region size to work around CPG msg limit to avoid hang.
Jonathan Brassow [Wed, 25 Feb 2015 20:42:15 +0000 (14:42 -0600)]
cmirror: Adjust region size to work around CPG msg limit to avoid hang.

cmirror uses the CPG library to pass messages around the cluster and maintain
its bitmaps.  When a cluster mirror starts-up, it must send the current state
to any joining members - a checkpoint.  When mirrors are large (or the region
size is small), the bitmap size can exceed the message limit of the CPG
library.  When this happens, the CPG library returns CPG_ERR_TRY_AGAIN.
(This is also a bug in CPG, since the message will never be successfully sent.)

There is an outstanding bug (bug 682771) that is meant to lift this message
length restriction in CPG, but for now we work around the issue by increasing
the mirror region size.  This limits the size of the bitmap and avoids any
issues we would otherwise have around checkpointing.

Since this issue only affects cluster mirrors, the region size adjustments
are only made on cluster mirrors.  This patch handles cluster mirror issues
involving pvmove, lvconvert (from linear to mirror), and lvcreate.  It also
ensures that when users convert a VG from single-machine to clustered, any
mirrors with too many regions (i.e. a bitmap that would be too large to
properly checkpoint) are trapped.

9 years agolvcreate.8: Mention --cachepolicy and --cachesettings.
Petr Rockai [Wed, 25 Feb 2015 17:34:01 +0000 (18:34 +0100)]
lvcreate.8: Mention --cachepolicy and --cachesettings.

9 years agolvmcache.7: add a section on --cachepolicy/--cachesettings
Petr Rockai [Wed, 25 Feb 2015 17:20:06 +0000 (18:20 +0100)]
lvmcache.7: add a section on --cachepolicy/--cachesettings

9 years agovgcfgbackup: enable foreign VG access
David Teigland [Wed, 25 Feb 2015 17:01:37 +0000 (11:01 -0600)]
vgcfgbackup: enable foreign VG access

Backup of a foreign VG is allowed.

9 years agosystemid: silently ignore foreign vgs unless named
David Teigland [Wed, 25 Feb 2015 16:44:42 +0000 (10:44 -0600)]
systemid: silently ignore foreign vgs unless named

A foreign VG should be silently ignored by a reporting/display
command like 'vgs'.  If the reporting/display command specifies
a foreign VG by name on the command line, it should produce an
error message.

Scanning commands pvscan/vgscan/lvscan are always allowed to
read and update caches from all PVs, including those that belong
to foreign VGs.

Other non-report/display/scan commands always ignore a foreign
VG, or report an error if they attempt to use a foreign VG.

vgimport should always invalidate the lvmetad cache because
lvmetad likely holds a pre-vgexported copy of the VG.
(This is unrelated to using foreign VGs; the pre-vgexported
VG may have had no system_id at all.)

9 years agotoolcontext: Fix lvmlocal.conf load fail path.
Alasdair G Kergon [Wed, 25 Feb 2015 16:36:47 +0000 (16:36 +0000)]
toolcontext: Fix lvmlocal.conf load fail path.

9 years agoexample.conf: Update systemid comments.
Alasdair G Kergon [Wed, 25 Feb 2015 14:22:24 +0000 (14:22 +0000)]
example.conf: Update systemid comments.

Avoid using 'cluster' (ambiguous).
Add holding ref for machine-id source.

9 years agosystemid: Improve concurrent warning.
Alasdair G Kergon [Wed, 25 Feb 2015 14:17:35 +0000 (14:17 +0000)]
systemid: Improve concurrent warning.

9 years agosystemid: Allow empty systemid with warnings.
Alasdair G Kergon [Wed, 25 Feb 2015 14:12:24 +0000 (14:12 +0000)]
systemid: Allow empty systemid with warnings.

Add warning messages when empty system ID is set.

9 years agocache: Fix a segfault when passing --cachepolicy without --cachesettings.
Petr Rockai [Tue, 24 Feb 2015 10:36:30 +0000 (11:36 +0100)]
cache: Fix a segfault when passing --cachepolicy without --cachesettings.

9 years agosystemid: Extend --foreign to reporting commands.
Alasdair G Kergon [Mon, 23 Feb 2015 23:41:38 +0000 (23:41 +0000)]
systemid: Extend --foreign to reporting commands.

Add --foreign to the remaining reporting and display commands plus
vgcfgbackup.
Add a NEEDS_FOREIGN_VGS flag for vgimport to always set --foreign.
If lvmetad is being used with --foreign, scan foreign VGs (currently
implemented as a full PV scan).
Handle these things centrally in lvmcmdline.c.
Also allow lvchange and vgchange -an/-aln to deactivate any foreign
LVs that happen to be active if something went wrong.
Remember to set the system ID when creating a new VG in vgsplit.

9 years agosystemid: Fix access restrictions.
Alasdair G Kergon [Mon, 23 Feb 2015 23:19:36 +0000 (23:19 +0000)]
systemid: Fix access restrictions.

When checking whether the system ID permits access to a VG, check for
each permitted situation first, and only then issue the appropriate
error message.  Always issue a message for now.  (We'll try to
suppress some of those later when the VG concerned wasn't explicitly
requested.)
Add more messages to try to ensure every return code is checked and
every error path (and only an error path) contains a log_error().
Add self-correction to vgchange -c to deal with situations where
the cluster state and system ID state are out-of-sync (e.g. if
old tools were used).

9 years agolvm1: Reenable sys ID.
Alasdair G Kergon [Mon, 23 Feb 2015 23:03:52 +0000 (23:03 +0000)]
lvm1: Reenable sys ID.

Move the lvm1 sys ID into vg->lvm1_system_id and reenable the #if 0
LVM1 code.  Still display the new-style system ID in the same
reporting field, though, as only one can be set.
Add a format feature flag FMT_SYSTEM_ON_PVS for LVM1 and disallow
access to LVM1 VGs if a new-style system ID has been set.
Treat the new vg->system_id as const.

9 years agoconfig: Rename allow_system_id to extra_system_ids.
Alasdair G Kergon [Mon, 23 Feb 2015 22:19:08 +0000 (22:19 +0000)]
config: Rename allow_system_id to extra_system_ids.

Add warnings to the config file templates and briefly document
each value.
Configure lvmlocal.conf and install in /etc/lvm.

9 years agoconfig: Adjust system_id defaults.
Alasdair G Kergon [Mon, 23 Feb 2015 21:20:51 +0000 (21:20 +0000)]
config: Adjust system_id defaults.

Allow cmd->unknown_system_id to be cleared during toolcontext
refresh.
Set a default value of "none" for global/system_id_source.
Allow local/system_id to be empty so it's not impossible for
a later config file to remove it.

9 years agosystemid: Define file content more precisely.
Alasdair G Kergon [Mon, 23 Feb 2015 20:49:15 +0000 (20:49 +0000)]
systemid: Define file content more precisely.

In a file containing a system ID:
  Any whitespace at the start of a line is ignored;
  Blank lines are ignored;
  Any characters after a # are ignored along with the #.
  The system ID is obtained by processing the first line with
non-ignored characters.
  If further lines with non-ignored characters follow, a warning is
issued.

9 years agosystemid: Add warnings if invalid.
Alasdair G Kergon [Mon, 23 Feb 2015 20:36:27 +0000 (20:36 +0000)]
systemid: Add warnings if invalid.

Add WARNING messages if there are problems setting the requested
system ID.
Ban "localhost" as a prefix regardless of the system_id_source.
Use cmd->hostname instead of calling uname again.
Make system_id_source values case-insensitive (as with new settings like
log_debug_classes) and also accept machine-id to match the filename.

9 years agotoolcontext: Include system_id in refresh.
Alasdair G Kergon [Mon, 23 Feb 2015 20:21:00 +0000 (20:21 +0000)]
toolcontext: Include system_id in refresh.

Move _init_system_id() into _process_config() so it's also called when
refreshing the toolcontext.  Add WARNING to log_warn messages.

9 years agotoolcontext: Move lvmlocal.conf loading.
Alasdair G Kergon [Mon, 23 Feb 2015 20:11:00 +0000 (20:11 +0000)]
toolcontext: Move lvmlocal.conf loading.

Load lvmlocal.conf after basic initialisation from lvm.conf.

9 years agosystemid: Require alphanumeric 1st character.
Alasdair G Kergon [Mon, 23 Feb 2015 19:47:03 +0000 (19:47 +0000)]
systemid: Require alphanumeric 1st character.

Require system ID to begin with an alphanumeric character.
Rename fn to make clear it's only validation for systemid
and always terminate result rather than imposing this on the caller.

9 years agoformat_text: Fix creation_host_system_id.
Alasdair G Kergon [Mon, 23 Feb 2015 19:19:48 +0000 (19:19 +0000)]
format_text: Fix creation_host_system_id.

Don't escape quotes - forbidden characters.

9 years agoformat_text: Store creation_host_system_id.
Alasdair G Kergon [Mon, 23 Feb 2015 17:54:47 +0000 (17:54 +0000)]
format_text: Store creation_host_system_id.

Record the current system ID at the time of writing out VG metadata
in the outer section of it alongside the hostname and time.

9 years agoconfig: Reinstate recursive tags setting.
Alasdair G Kergon [Mon, 23 Feb 2015 17:40:58 +0000 (17:40 +0000)]
config: Reinstate recursive tags setting.

In 2.02.99, _init_tags() inadvertently began to ignore the
dm_config_tree struct passed to it.  "tags" sections are not
merged together, so the "tags" section in the main config file was
being processed repeatedly and other "tags" sections were ignored.

9 years agosystemid: Add built-in systemid command.
Alasdair G Kergon [Mon, 23 Feb 2015 17:26:50 +0000 (17:26 +0000)]
systemid: Add built-in systemid command.

Make it easy to find the system ID when testing.
Also show in general debug output.

9 years agolvm-string: Fix HYPEN typo.
Alasdair G Kergon [Mon, 23 Feb 2015 17:09:35 +0000 (17:09 +0000)]
lvm-string: Fix HYPEN typo.

9 years agolvmetad: Add fn to scan only foreign VGs.
Alasdair G Kergon [Mon, 23 Feb 2015 17:03:03 +0000 (17:03 +0000)]
lvmetad: Add fn to scan only foreign VGs.

Not implemented yet - just a wrapper.

9 years agoman lvmsystemid: update changing the system_id
David Teigland [Fri, 20 Feb 2015 22:55:27 +0000 (16:55 -0600)]
man lvmsystemid: update changing the system_id

9 years agoman lvm: document --foreign option
David Teigland [Fri, 20 Feb 2015 22:26:04 +0000 (16:26 -0600)]
man lvm: document --foreign option

9 years agovgchange, vgcreate: add systemid option to command help
David Teigland [Fri, 20 Feb 2015 21:31:17 +0000 (15:31 -0600)]
vgchange, vgcreate: add systemid option to command help

9 years agoman: systemid option for vgcreate and vgchange
David Teigland [Fri, 20 Feb 2015 20:58:01 +0000 (14:58 -0600)]
man: systemid option for vgcreate and vgchange

9 years agotests: skip system_id machineid case when not available
David Teigland [Fri, 20 Feb 2015 19:12:38 +0000 (13:12 -0600)]
tests: skip system_id machineid case when not available

instead of creating a fake /etc/machine-id file on the
system to test with.

9 years agoman lvmsystemid: expanded limitations and warnings
David Teigland [Fri, 20 Feb 2015 18:21:23 +0000 (12:21 -0600)]
man lvmsystemid: expanded limitations and warnings

9 years agoreport: fix foreign reporting without lvmetad
David Teigland [Thu, 19 Feb 2015 21:24:31 +0000 (15:24 -0600)]
report: fix foreign reporting without lvmetad

9 years agotests: add system_id test
David Teigland [Thu, 19 Feb 2015 20:08:51 +0000 (14:08 -0600)]
tests: add system_id test

9 years agodoc: explanation of caching foreign VGs
David Teigland [Thu, 19 Feb 2015 17:33:23 +0000 (11:33 -0600)]
doc: explanation of caching foreign VGs

9 years agoman: update lvmthin about repair and recovery
David Teigland [Fri, 6 Feb 2015 10:24:30 +0000 (04:24 -0600)]
man: update lvmthin about repair and recovery

Explain the thin metadata repair might not work.
Clarify that a full thin pool won't require fsck for journaled fs.

9 years agoconfigure: typo in configure --with-default-raid10-segtype causing it to be unrecognized
Peter Rajnoha [Thu, 19 Feb 2015 15:17:19 +0000 (16:17 +0100)]
configure: typo in configure --with-default-raid10-segtype causing it to be unrecognized

AC_ARG_WITH(default-raid10r-segtype --> AC_ARG_WITH(default-raid10-segtype

(...raid10r... --> ...raid10... - extra "r")

9 years agocleanup: drop unused header file
Zdenek Kabelac [Thu, 19 Feb 2015 13:42:27 +0000 (14:42 +0100)]
cleanup: drop unused header file

9 years agocleanup: simplify error path code
Zdenek Kabelac [Thu, 19 Feb 2015 13:06:17 +0000 (14:06 +0100)]
cleanup: simplify error path code

Mempool needs to free only with first alllocated element,
everything allocated afterwards is released as well.

9 years agocleanup: drop unused value assign
Zdenek Kabelac [Thu, 19 Feb 2015 13:03:45 +0000 (14:03 +0100)]
cleanup: drop unused value assign

Dop unused value assignments.

Unknown is detected via other combination
(!linear && !striped).

Also change the log_error() message into a warning,
since the function is not really returning error,
but still keep the INTERNAL_ERROR.

Ret value is always set later.

9 years agopvcreate: switch to "none" dev-ext source during pvcreate
Peter Rajnoha [Thu, 19 Feb 2015 13:30:20 +0000 (14:30 +0100)]
pvcreate: switch to "none" dev-ext source during pvcreate

The dev ext source must be reset for the dev_cache_get call
(which evaluates filters), not lvmcache_label_scan - so fix
original commit 727c7ff85d448743f751bc5218e73c41314ed5f1.

Also, add comments in _pvcreate_check fn explaining why
refresh filter and rescan is needed and exactly in which
situations.

9 years agowiping: blkid: do not count skipped signatures in final number of wipes
Peter Rajnoha [Thu, 19 Feb 2015 12:20:01 +0000 (13:20 +0100)]
wiping: blkid: do not count skipped signatures in final number of wipes

We exclude some signatures from being wiped when using blkid wiping.
These are signatures which we simply overwrite. For example, the
LVM2_member signature which denotes a PV - if we call pvcreate on
existing PV, we just overwrite the PV header, no need to wipe it.

Previously, we counted such signatures as if they were wiped
and they were counted in the final number of wiped signatures
that _wipe_known_signatures_with_blkid fn returned in the "wiped"
output arg. Then the code checking this output arg could be
mislead that wiping happened while no wiping took place in real
and we could fire some code uselessly based on this information
(e.g. refreshing filters/rescanning - see also
commit 6b4066585f73df7328ea16f6cb3713cd49cf2d2d).

9 years agoclvmd: Fix BZ 1140095 by updating lastfd upon EINTR.
Petr Rockai [Wed, 18 Feb 2015 11:45:43 +0000 (12:45 +0100)]
clvmd: Fix BZ 1140095 by updating lastfd upon EINTR.

9 years agotest: Avoid a race in pvmove-restart.sh.
Petr Rockai [Wed, 18 Feb 2015 11:27:47 +0000 (12:27 +0100)]
test: Avoid a race in pvmove-restart.sh.

9 years agotest: Make pvmove0 device removal more robust, in pvmove-restart.sh.
Petr Rockai [Wed, 18 Feb 2015 09:17:43 +0000 (10:17 +0100)]
test: Make pvmove0 device removal more robust, in pvmove-restart.sh.

9 years agotests: hide uninteresting output
Zdenek Kabelac [Tue, 17 Feb 2015 14:53:24 +0000 (15:53 +0100)]
tests: hide uninteresting output

We don't care about diff output.

9 years agoNIX: Fix a typo that broke evaluation of fc19+.
Petr Rockai [Tue, 17 Feb 2015 13:41:51 +0000 (14:41 +0100)]
NIX: Fix a typo that broke evaluation of fc19+.

9 years agocleanup: fix compate of return value
Zdenek Kabelac [Tue, 17 Feb 2015 12:40:35 +0000 (13:40 +0100)]
cleanup: fix compate of return value

Drop '!' for 'ret' compare.
Since the effect of false compare was only stack trace printing,
it present no real code flow change.

9 years agocleanup: drop !! from code
Zdenek Kabelac [Tue, 17 Feb 2015 12:39:47 +0000 (13:39 +0100)]
cleanup: drop !! from code

It's unused piece of code - but gcc5 noticed problem with
usage of !! on the leftside.

9 years agocleanup: drop unused val
Zdenek Kabelac [Tue, 17 Feb 2015 12:39:26 +0000 (13:39 +0100)]
cleanup: drop unused val

9 years agotests: syncaction update
Zdenek Kabelac [Tue, 17 Feb 2015 10:03:20 +0000 (11:03 +0100)]
tests: syncaction update

Improve syncaction testing with some minor
workaround for current upstream kernel

9 years agotests: ensure lv1 goes away first
Zdenek Kabelac [Mon, 16 Feb 2015 09:53:22 +0000 (10:53 +0100)]
tests: ensure lv1 goes away first

$lv1 may appear in the table after -pvmove0 which could make -pvmove0
unremovable.

9 years agofilters: no need to refresh filters/rescan if no signature is wiped during pvcreate...
Peter Rajnoha [Tue, 17 Feb 2015 08:46:34 +0000 (09:46 +0100)]
filters: no need to refresh filters/rescan if no signature is wiped during pvcreate at all

Before, we refreshed filters and we did full rescan of devices if
we passed through wiping (wipe_known_signatures fn call). However,
this fn returns success even if no signatures were found and so
nothing was wiped. In this case, it's not necessary to do the
filter refresh/rescan of devices as nothing changed clearly.

This patch exports number of wiped signatures from all the
wiping functions below. The caller (_pvcreate_check) then checks
whether any wiping was done at all and if not, no refresh/rescan
is done, saving some time and resources.

9 years agospec: Include lvmsystemid.7 in RPMs.
Petr Rockai [Mon, 16 Feb 2015 16:14:23 +0000 (17:14 +0100)]
spec: Include lvmsystemid.7 in RPMs.

9 years agoNIX: Fix CentOS builds.
Petr Rockai [Mon, 16 Feb 2015 14:29:29 +0000 (15:29 +0100)]
NIX: Fix CentOS builds.

This page took 0.071732 seconds and 5 git commands to generate.