]> sourceware.org Git - lvm2.git/log
lvm2.git
9 years agotests: export shell vars
Zdenek Kabelac [Thu, 19 Mar 2015 10:23:44 +0000 (11:23 +0100)]
tests: export shell vars

Export vars so they are visible in  'aux' calls as well.
(reenables cluster testing)

9 years agomakefiles: add more dirs for lcov
Zdenek Kabelac [Thu, 19 Mar 2015 09:23:57 +0000 (10:23 +0100)]
makefiles: add more dirs for lcov

lvmetad lcovered.

9 years agocache: Store metadata size and checksum.
Alasdair G Kergon [Wed, 18 Mar 2015 23:43:02 +0000 (23:43 +0000)]
cache: Store metadata size and checksum.

Refactor the recent metadata-reading optimisation patches.

Remove the recently-added cache fields from struct labeller
and struct format_instance.

Instead, introduce struct lvmcache_vgsummary to wrap the VG information
that lvmcache holds and add the metadata size and checksum to it.

Allow this VG summary information to be looked up by metadata size +
checksum.  Adjust the debug log messages to make it clear when this
shortcut has been successful.

(This changes the optimisation slightly, and might be extendable
further.)

Add struct cached_vg_fmtdata to format-specific vg_read calls to
preserve state alongside the VG across separate calls and indicate
if the details supplied match, avoiding the need to read and
process the VG metadata again.

9 years agotoollib: Reorder process_each_pv initialisation.
Alasdair G Kergon [Wed, 18 Mar 2015 23:34:46 +0000 (23:34 +0000)]
toollib: Reorder process_each_pv initialisation.

Perform cheaper command line-based validation before more-expensive
processing and scanning.

9 years agopvs: Hide inaccessible clustered PVs.
Alasdair G Kergon [Wed, 18 Mar 2015 23:31:46 +0000 (23:31 +0000)]
pvs: Hide inaccessible clustered PVs.

Inaccessible clustered PVs can be hidden from pvs -a in the same way as
foreign PVs, rather than showing them as if they do not belong to a VG.

9 years agosystemid: Use correct mempool.
Alasdair G Kergon [Wed, 18 Mar 2015 23:25:30 +0000 (23:25 +0000)]
systemid: Use correct mempool.

libmem is necessary when this ends up in cmd->system_id.

9 years agocache: Retain orphans while global lock held.
Alasdair G Kergon [Wed, 18 Mar 2015 23:20:09 +0000 (23:20 +0000)]
cache: Retain orphans while global lock held.

Fixes segfault when 'pvs' encounters two different PVs sharing the same
uuid but one an orphan, the other in a VG.

If VG_GLOBAL is held, there seems no point in doing a full scan more
than once.

If undesirable side-effects show up, we can try restricting this to
VG_GLOBAL READ locks.  The original code dates back to 2.02.40.

9 years agopvscan: check sysfs dev entry before rescan
Zdenek Kabelac [Wed, 18 Mar 2015 15:19:58 +0000 (16:19 +0100)]
pvscan: check sysfs dev entry before rescan

When pvscan --cache --major --minor command is issued from
udev REMOVE event, it basically resulted into a whole device
scan since the device was missing. So avoid such scan
and first check via /sysfs (when available) if such device actually
exists.

9 years agoconfig: use timestamp with nanosecond precision
Zdenek Kabelac [Wed, 18 Mar 2015 09:59:41 +0000 (10:59 +0100)]
config: use timestamp with nanosecond precision

Since kernel 2.6 we can use more precise timestamping,
so e.g. we could better recognize configs are slightly
older then generated .cache file.

9 years agolvm-file: wrapper to read ctim from stat
Zdenek Kabelac [Wed, 18 Mar 2015 09:54:08 +0000 (10:54 +0100)]
lvm-file: wrapper to read ctim from stat

When available use nanosecond stat info.

If commands are running closely enough after config update,
the .cache file from persistent filter could have been ignored.

This happens sometimes during i.e. synthetic test suite run.

9 years agoconfigure: detect st_ctim
Zdenek Kabelac [Wed, 18 Mar 2015 09:52:40 +0000 (10:52 +0100)]
configure: detect st_ctim

Check stat has nanosecond precision for ctim.

9 years agolvchange: disable persistent minors for pools
Zdenek Kabelac [Tue, 17 Mar 2015 08:44:26 +0000 (09:44 +0100)]
lvchange: disable persistent minors for pools

There is no reason to support persistent major/minor numbers
for pool volumes - it's only meant to be supported for filesystems
(since i.e. nfs may need to keep volume on a persistent device node.)

Support for pools is now explicitely disabled and documented.

9 years agometadata: Fix recent vg_validate message text.
Alasdair G Kergon [Tue, 17 Mar 2015 17:48:56 +0000 (17:48 +0000)]
metadata: Fix recent vg_validate message text.

9 years agolvmetad: pvscan: do not scan and read ignored MDAs from PVs
Peter Rajnoha [Mon, 16 Mar 2015 16:00:36 +0000 (17:00 +0100)]
lvmetad: pvscan: do not scan and read ignored MDAs from PVs

Metadata areas which are marked as ignored should not be scanned
and read during pvscan --cache. Otherwise, this can cause lvmetad
to cache out-of-date metadata in case other PVs with fresh metadata
are missing by chance.

Make this to work like in non-lvmetad case where the behaviour would
be the same as if the PV was orphan (in case we have no other PVs
with valid non-ignored metadata areas).

9 years agotests: add ""
Zdenek Kabelac [Mon, 16 Mar 2015 13:57:14 +0000 (14:57 +0100)]
tests: add ""

Add missing "" around 'devs' (since they could
theoritically constain spaces in its name - not
likely supported with udev these day but anyway....)

9 years agotests: fix select report
Zdenek Kabelac [Mon, 16 Mar 2015 13:55:58 +0000 (14:55 +0100)]
tests: fix select report

Simplify the function usage and clean up parameter parsing.

There were 2 significant changes made in the test itself
(they passed before because of incorrect shell string handling)

-pvs_sel 'tags="pv_tag1"' "$dev1 $dev2"
+sel pv 'tags="pv_tag1"' "$dev1" "$dev6"

-lvs_sel '(lv_name=vol1 || lv_name=vol2) || vg_tags=vg_tag1' "vol1 vol2
abc orig snap"
+sel lv '(lv_name=vol1 || lv_name=vol2) || vg_tags=vg_tag1' vol1 vol2
orig snap xyz

9 years agotests: check for dmeventd first
Zdenek Kabelac [Mon, 16 Mar 2015 11:26:00 +0000 (12:26 +0100)]
tests: check for dmeventd first

Check there is no dmeventd before creating vg.

9 years agotests: drop unused ""
Zdenek Kabelac [Fri, 13 Mar 2015 10:39:55 +0000 (11:39 +0100)]
tests: drop unused ""

9 years agosystemd: blk-availability.service: add After=iscsi-shutdown.service
Peter Rajnoha [Fri, 13 Mar 2015 11:05:47 +0000 (12:05 +0100)]
systemd: blk-availability.service: add After=iscsi-shutdown.service

The iscsi-shutdown.service is the one responsible for logging out
iscsi sessions so blk-availability.service (running the blkdeactivate
script) should be run before that on shutdown (so we need to use
After=iscsi-shutdown.service because "After" relates to starting
the service and the opposite order is automatically applied on
stopping the service at shutdown).

9 years agotests: few more warnings for gcc only
Zdenek Kabelac [Wed, 11 Mar 2015 23:12:15 +0000 (00:12 +0100)]
tests: few more warnings for gcc only

g++ doesn't like them.

9 years agotests: avoid loop on older system
Zdenek Kabelac [Wed, 11 Mar 2015 23:07:45 +0000 (00:07 +0100)]
tests: avoid loop on older system

Cleanup overload of 'push'.
Don't busy-loop when reading is finished.

9 years agotests: update runner
Zdenek Kabelac [Wed, 11 Mar 2015 20:13:41 +0000 (21:13 +0100)]
tests: update runner

Avoid busy-looping on CPU while reading socket pipe
and always call read only when select tells there is
something for read.

Change the batch output to old nicer output.

9 years agotests: update makefile
Zdenek Kabelac [Wed, 11 Mar 2015 20:11:09 +0000 (21:11 +0100)]
tests: update makefile

Respect $LVM_TEST_RESULT dir
Share same target for  clean: & distclean:
Cleanup path-common

9 years agotests: drop unneeded comment
Zdenek Kabelac [Wed, 11 Mar 2015 14:42:44 +0000 (15:42 +0100)]
tests: drop unneeded comment

9 years agotests: capture and print thrown errors
Zdenek Kabelac [Wed, 11 Mar 2015 14:42:20 +0000 (15:42 +0100)]
tests: capture and print thrown errors

9 years agotests: do not leak in mem in destructor
Zdenek Kabelac [Wed, 11 Mar 2015 14:41:53 +0000 (15:41 +0100)]
tests: do not leak in mem in destructor

9 years agomakefiles: split gcc -W options
Zdenek Kabelac [Wed, 11 Mar 2015 14:41:03 +0000 (15:41 +0100)]
makefiles: split gcc -W options

Avoid using gcc only Warnings for compilation of g++ object files.

9 years agotests: extend race
Zdenek Kabelac [Thu, 19 Feb 2015 16:08:33 +0000 (17:08 +0100)]
tests: extend race

Mark test as skipped, if the test could not be made.

9 years agotests: drop old workaround
Zdenek Kabelac [Wed, 11 Mar 2015 08:54:08 +0000 (09:54 +0100)]
tests: drop old workaround

Should be usable now without this 'should'.

9 years agotests: specify old mirror type
Zdenek Kabelac [Wed, 11 Mar 2015 08:53:35 +0000 (09:53 +0100)]
tests: specify old mirror type

Use old mirror (otherwise it would need  aux have_raid)

9 years agotests: cleanup some cxx warnings
Zdenek Kabelac [Wed, 11 Mar 2015 10:00:55 +0000 (11:00 +0100)]
tests: cleanup some cxx warnings

9 years agotests: enable kmsg by default
Zdenek Kabelac [Wed, 11 Mar 2015 09:43:28 +0000 (10:43 +0100)]
tests: enable kmsg by default

By default we want to capture kernel log into test trace
(since when test crashes it could be problem to reproduce).

9 years agotests: extend test timeout to 180sec
Zdenek Kabelac [Wed, 11 Mar 2015 09:46:51 +0000 (10:46 +0100)]
tests: extend test timeout to 180sec

Some test could take more then minute (with slow udev and slow
emulation) - extend timeout to 180sec.

9 years agoreporting: should not fail with foreign option if lvm1 pvs exist
David Teigland [Tue, 10 Mar 2015 18:56:25 +0000 (13:56 -0500)]
reporting: should not fail with foreign option if lvm1 pvs exist

When lvm1 PVs are visible, and lvmetad is used, and the foreign
option was included in the reporting command, the reporting
command would fail after the 'pvscan all devs' function saw
the lvm1 PVs.  There is no reason the command should fail
because of the lvm1 PVs; they should just be ignored.

9 years agotests: update to not run vgconvert -M with lvmetad
David Teigland [Tue, 10 Mar 2015 14:59:52 +0000 (09:59 -0500)]
tests: update to not run vgconvert -M with lvmetad

9 years agoWHATS_NEW vgconvert -M fix
David Teigland [Tue, 10 Mar 2015 14:38:43 +0000 (09:38 -0500)]
WHATS_NEW vgconvert -M fix

9 years agovgconvert: require lvmetad to not be used
David Teigland [Tue, 10 Mar 2015 14:31:54 +0000 (09:31 -0500)]
vgconvert: require lvmetad to not be used

lvmetad does not work with lvm1/format1 metadata,
and vgconvert -M converts to or from lvm1 metadata,
so disallow vgconvert -M when lvmetad is used.

9 years agolibdaemon: map error level properly
Ondrej Kozina [Tue, 10 Mar 2015 13:35:29 +0000 (14:35 +0100)]
libdaemon: map error level properly

internal daemon error log level was wrongly mapped to debug syslog
level causing most error messages were lost in non-debug mode.

9 years agoconfigure: check for sync-nand
Zdenek Kabelac [Tue, 10 Mar 2015 12:36:55 +0000 (13:36 +0100)]
configure: check for sync-nand

Check whether gcc support this flag.
Some older compilers (gcc version 4.3.2) miss it.

9 years agodisplay: fix return values
Zdenek Kabelac [Mon, 9 Mar 2015 13:16:41 +0000 (14:16 +0100)]
display: fix return values

Return 1 on success in pvdisplay_short() and lvdisplay_full()
so commands like vgdisplay are not printinig stracktraces
on successful passes.

As the results of fail/success have been internally ignored for those
calls, it had no other visible side effect - command's return value was
still 0 (success).

9 years agoformat_text: Set system id directly.
Alasdair G Kergon [Mon, 9 Mar 2015 19:33:27 +0000 (19:33 +0000)]
format_text: Set system id directly.

Rearrange _read_vg code to set the appropriate system id field directly.

9 years agosystemid: Use temp status var for LVM_WRITE_LOCKED
Alasdair G Kergon [Mon, 9 Mar 2015 19:18:14 +0000 (19:18 +0000)]
systemid: Use temp status var for LVM_WRITE_LOCKED

9 years agovgchange: Additional system ID warnings.
Alasdair G Kergon [Mon, 9 Mar 2015 19:03:11 +0000 (19:03 +0000)]
vgchange: Additional system ID warnings.

Also prompt before setting a system ID on a VG when none is set
on the host.
Put quotes round system ID in messages where it could be blank.

9 years agovgconvert: Check system ID compatibility.
Alasdair G Kergon [Mon, 9 Mar 2015 19:01:12 +0000 (19:01 +0000)]
vgconvert: Check system ID compatibility.

If system ID is set, don't switch to a format that doesn't support it.

9 years agometadata: Detect internal use of LVM_WRITE_LOCKED.
Alasdair G Kergon [Mon, 9 Mar 2015 18:56:24 +0000 (18:56 +0000)]
metadata: Detect internal use of LVM_WRITE_LOCKED.

Generate internal error if LVM_WRITE_LOCKED ever appears
in struct volume_group: it's only used in external
metadata.

9 years agocomments: Use full flag names.
Alasdair G Kergon [Mon, 9 Mar 2015 18:53:22 +0000 (18:53 +0000)]
comments: Use full flag names.

9 years agosystem_id: detect an lvm1 system id
David Teigland [Mon, 9 Mar 2015 18:27:34 +0000 (13:27 -0500)]
system_id: detect an lvm1 system id

Detect an lvm1 system id by looking at the WRITE_LOCKED flag.
Don't copy this lvm1 system id into vg->system_id so that the
restrictions associated with the new system id are not applied
to the old VG with the inherited lvm1 system id.

9 years agotests: fix systemid uname test
David Teigland [Fri, 6 Mar 2015 15:55:24 +0000 (09:55 -0600)]
tests: fix systemid uname test

The string reported by uname -n may include characters
that lvm omits from the system id (like parens, as seen
on a test machine.)  Check against the final system id
string that lvm uses.

9 years agotests: speed of many PVS in a VG
Zdenek Kabelac [Fri, 6 Mar 2015 13:29:26 +0000 (14:29 +0100)]
tests: speed of many PVS in a VG

9 years agotests: slightly more efficient vgcreate
Zdenek Kabelac [Fri, 6 Mar 2015 12:29:35 +0000 (13:29 +0100)]
tests: slightly more efficient vgcreate

With larger set of devices it's faster to directly call
vgcreate on empty set of devices then going though separate
pvcreate call first.

9 years agolib: drop unneeded vg_read call
Zdenek Kabelac [Fri, 6 Mar 2015 09:22:33 +0000 (10:22 +0100)]
lib: drop unneeded vg_read call

Since we take a lock inside vg_lock_newname() and we do a full
detection of presence of  vgname inside all scanned labels,
there is no point to do this for second time to be sure
there is no such vg.

The only side-effect of such call would be a full validation of
some already exising VG metadata - but that's not the task for
vgcreate when create a new VG.

This call noticable reduces number of scans during 'vgcreate'.

9 years agolib: reduce parsing in vgname_from_mda
Zdenek Kabelac [Fri, 6 Mar 2015 09:24:26 +0000 (10:24 +0100)]
lib: reduce parsing in vgname_from_mda

Use similar logic as with text_vg_import_fd() and avoid repeated
parsing of same mda and its config tree for vgname_from_mda().

Remember last parsed vgname, vgid and creation_host in labeller
structure and if the  metadata have the same size and checksum,
return this stored info.

TODO: The reuse of labeller struct is not ideal, some lvmcache API for
this functionality would be nicer.

9 years agolib: avoid reparsing same metadata
Zdenek Kabelac [Mon, 26 Mar 2012 11:35:26 +0000 (13:35 +0200)]
lib: avoid reparsing same metadata

When reading VG mda from multiple PVs - do all the validation only
when mda is seen for the first time and  when mda checksum and length
is same just return already existing VG pointer.

(i.e. using 300PVs for a VG would lead to create and destroy 300 config trees....)

9 years agocleanup: add stack trace
Zdenek Kabelac [Fri, 6 Mar 2015 10:12:16 +0000 (11:12 +0100)]
cleanup: add stack trace

Missed stack in error path.

9 years agolib: return value
Zdenek Kabelac [Fri, 6 Mar 2015 08:04:31 +0000 (09:04 +0100)]
lib: return value

Drop label out: with goto and return NULL directly.
Add log_debug() for zero metadata offset.

9 years agolib: zero returned labeller struct
Zdenek Kabelac [Fri, 6 Mar 2015 07:42:20 +0000 (08:42 +0100)]
lib: zero returned labeller struct

Return zeroed struct.
(Structure will be extended, so ensure all members are initilized.)

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

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