]> sourceware.org Git - lvm2.git/log
lvm2.git
8 years agocleanup: adjust once
Zdenek Kabelac [Tue, 19 Jan 2016 10:44:11 +0000 (11:44 +0100)]
cleanup: adjust once

8 years agocleanup: update check function
Zdenek Kabelac [Fri, 15 Jan 2016 13:41:02 +0000 (14:41 +0100)]
cleanup: update check function

Use display_lvname().
Use lv_is_lockd_sanlock_lv().
Order  'error' checks ahead of 'ignore' ones.

8 years agocleanup: shuffle check of threshold
Zdenek Kabelac [Fri, 15 Jan 2016 13:39:58 +0000 (14:39 +0100)]
cleanup: shuffle check of threshold

Check first threshold and then policy_amount.

8 years agocleanup: use log_print
Zdenek Kabelac [Fri, 15 Jan 2016 09:35:10 +0000 (10:35 +0100)]
cleanup: use log_print

Using log_print for ignoring message instead of log_warn.
Add some missing '.'.

8 years agoactivation: remote node check doesn't work yet
Alasdair G Kergon [Wed, 20 Jan 2016 02:54:11 +0000 (02:54 +0000)]
activation: remote node check doesn't work yet

8 years agoclvmd: Initialise udev.
Alasdair G Kergon [Wed, 20 Jan 2016 00:58:09 +0000 (00:58 +0000)]
clvmd: Initialise udev.

Since commit 2fc126b00d83991c6a2f3ed9aa61457294a4c45e, the library
code requires udev to be initialised for device scanning and
clvmd can fail to find VGs if devices/external_device_info_source
is set to "udev".

8 years agoactivation: Add lv_is_active_remotely.
Alasdair G Kergon [Tue, 19 Jan 2016 22:01:59 +0000 (22:01 +0000)]
activation: Add lv_is_active_remotely.

8 years agolocking: Add node parameter to query_resource.
Alasdair G Kergon [Tue, 19 Jan 2016 21:42:22 +0000 (21:42 +0000)]
locking: Add node parameter to query_resource.

8 years agoman: mention GPT id for LVM in pvcreate man page
Peter Rajnoha [Tue, 19 Jan 2016 14:28:44 +0000 (15:28 +0100)]
man: mention GPT id for LVM in pvcreate man page

8 years agoreport: fix off-by-one error when reporting LV segment's metadata device extent count
Peter Rajnoha [Tue, 19 Jan 2016 13:42:51 +0000 (14:42 +0100)]
report: fix off-by-one error when reporting LV segment's metadata device extent count

Commit a3f484f812bfb89063fbc25e378f34cacd50bf7d used "-1" two times by
mistake for the extent count when reporting seg_metadata_le_ranges.

8 years agoreport: add note about seg_pe_ranges and seg_le_ranges in -o help
Peter Rajnoha [Tue, 19 Jan 2016 12:53:30 +0000 (13:53 +0100)]
report: add note about seg_pe_ranges and seg_le_ranges in -o help

8 years agoreport: add seg_le_ranges report field
Peter Rajnoha [Tue, 19 Jan 2016 12:51:11 +0000 (13:51 +0100)]
report: add seg_le_ranges report field

8 years agoreport: make devices, metadata_devices, seg_pe_ranges and seg_metadata_le_ranges...
Peter Rajnoha [Tue, 19 Jan 2016 11:26:01 +0000 (12:26 +0100)]
report: make devices, metadata_devices, seg_pe_ranges and seg_metadata_le_ranges fields consistent

There are two basic groups of fields for LV segment device reporting:
  - related to LV segment's devices: devices and seg_pe_ranges
  - related to LV segment's metadata devices: metadata_devices and seg_metadata_le_ranges

The devices and metadata_devices report devices in this format:
    "device_name(extent_start)"

The seg_pe_ranges and seg_metadata_le_ranges report devices in
this format:
    "device_name:extent_start-extent_end"

This patch reverts partly what commit 7f74a995029caa41ee3cf9aec0bd024a34bfd89a
(v 2.02.140) introduced in this area - it added [] for
hidden devices to mark them for all four fields mentioned above.

We won't be marking hidden devices in devices and metadata_devices
fields.

The seg_metadata_le_ranges field will have hidden devices marked -
it's new enough that we don't need to care about compatibility much
yet.

The seg_pe_ranges is old enough that we shouldn't be changing this
one - so we're reverting to not marking hidden devices here.
Instead, there's going to be a new field "seg_le_ranges" which
is going to replace the seg_pe_ranges and it will mark hidden devices -
this is going to be introduced in a patch later.

So in the end we'll end up with:

   (LV segment's devices)
   devices field with "device_name(extent_start)" format, not marking hidden devices
   seg_pe_ranges field with "device_name:extent_start-extent_end" format, not marking hidden devices (deprecated, new seg_le_ranges should be used instead for standardized format)
   seg_le_ranges field with "device_name:extent_start-extent_end" format, marking hidden devices

   (LV segment's metadata devices)
   metadata_devices field with "device_name:extent_start-extent_end" format, not marking hidden devices
   seg_metadata_le_ranges field with "device_name:extent_start-extent_end" format, marking hidden devices

Also, both seg_le_ranges and seg_metadata_le_ranges will honour the
report/list_item_separator setting which can be used to configure
the delimiter used for list items.

So, to sum it up, we will recommend using the new seg_le_ranges and
seg_metadata_le_ranges fields because they display devices with
standard extent range format, they can mark hidden devices and they
honour the report/list_item_separator setting.

We'll be keeping devices,seg_pe_ranges and metadata_devices fields
for compatibility.

8 years agoreport: change _format_pvsegs to return list instead of plain string, change associat...
Peter Rajnoha [Tue, 19 Jan 2016 11:24:02 +0000 (12:24 +0100)]
report: change _format_pvsegs to return list instead of plain string, change associated report fields from STR to STR_LIST

The associated devices,metadata_devices,seg_pe_ranges and
seg_metadata_le_ranges are reported as genuine string lists now.
This allows for using the items separately in -S|--select
(so searching for subsets etc.) and also it allows for
configuring the separator using report/list_item_separator
which may be useful in scripts (however, we'll enable this
only for seg_le_metadata_ranges and not for devices,seg_pe_ranges
and seg_metadata_devices for compatibility reasons - see following
patch).

8 years agorefactor: add 'delimiter' variable for non-default delimiter when reporting string...
Peter Rajnoha [Tue, 19 Jan 2016 10:50:41 +0000 (11:50 +0100)]
refactor: add 'delimiter' variable for non-default delimiter when reporting string list

8 years agolvconvert: disallow test mode in shared VG
David Teigland [Mon, 18 Jan 2016 22:53:14 +0000 (16:53 -0600)]
lvconvert: disallow test mode in shared VG

until test mode can be checked in all the necessary
locations related to lvmlockd to prevent making
actual changes.

8 years agotoollib: add comment about missing device
David Teigland [Mon, 18 Jan 2016 21:40:42 +0000 (15:40 -0600)]
toollib: add comment about missing device

Add a comment in _process_pvs_in_vg() to document the
place where there have been problems with processing
PVs twice.

For a while we had a hacky workaround here where we'd
skip processing a PV if its device wasn't found in
all_devices (and !is_missing_pv since we want to
process PVs with missing devices.).  That workaround
was removed in commit 5cd4d46f because it was no
longer needed.

The workaround had originally been needed to prevent
a device from being processed twice when the PV had
no MDAs -- it would be processed once in its real VG
and then the workaround would prevent it from being
processed a second time in the orphan VG.

Wrongly appearing as an orphan likely happened because
lvmcache would consider the no-MDA PV an orphan unless
the real VG holding that PV was also in lvmcache.
This issue is also mentioned in pvchange where holding
the global lock allows VGs to remain in lvmcache so
PVs with 0 mdas are not considered orphans.

The workaround in _process_pvs_in_vg() was originally
intended for reporting commands, not for pvchange.
But, it was accidentally helping pvchange also because
the method described by the pvchange global lock
comment had been subverted by commit 80f4b4b8.
Commit 80f4b4b8 was found to be unnecessary, and was
reverted in commit e710bac0.  This restored the
intended global lock lvmcache effect to pvchange, and
it no longer relied on the workaround in toollib.

8 years agoreport: Fix seg_pe_ranges LV sizes.
Alasdair G Kergon [Mon, 18 Jan 2016 22:04:43 +0000 (22:04 +0000)]
report: Fix seg_pe_ranges LV sizes.

When reporting on LVs, take the end of the range from the size of the
underlying (hidden) LV rather than the logical size of the current
segment (that PVs use).

8 years agopvmove: use toollib
David Teigland [Tue, 12 Jan 2016 20:57:52 +0000 (14:57 -0600)]
pvmove: use toollib

Previously, pvmove used the function find_pv_in_vg() which did the
equivalent of process_each_pv() by doing:

  find_pv_by_name() -> get_pvs() ->

  get_pvs_internal() -> _get_pvs() -> get_vgids() ->

  /* equivalent to process_each_pv */
  dm_list_iterate_items(vgids)
    vg = vg_read_internal()
    dm_list_iterate_items(&vg->pvs)

With the found 'pv', it would do vg_read() on pv_vg_name(pv),
and then do the actual pvmove processing.

This commit simplifies by using process_each_pv() and putting
the actual pvmove processing into the "single" function.
This eliminates both find_pv_by_name() and the vg_read().
The processing code that followed vg_read remains the same.

The return code for the pvmove command is not based on the
process_each_pv return code, but is based on the success/fail
conditions in the existing code.

8 years agoRevert "Revert "process_each_pv: remove unnecessary workaround""
David Teigland [Thu, 14 Jan 2016 19:47:44 +0000 (13:47 -0600)]
Revert "Revert "process_each_pv: remove unnecessary workaround""

This reverts commit 6d09c8c2c45ea1dea243134b8badc841a87cc979.

Try again to remove the workaround.

8 years agolvmlockd: cosemtic improvements to logging
David Teigland [Fri, 15 Jan 2016 21:34:49 +0000 (15:34 -0600)]
lvmlockd: cosemtic improvements to logging

Also pass our name to sanlock so it appears in
the sanlock status output.

8 years agolvmlockd: fix lvb validation for conversion
David Teigland [Fri, 15 Jan 2016 21:31:13 +0000 (15:31 -0600)]
lvmlockd: fix lvb validation for conversion

Make the lvb validation rules for convert match
those for unlock (even though it would be very
unlikely or impossible for convert to deal with
zero lvb.)

8 years agopvchange, pvresize: fix lockd_gl() usage
David Teigland [Fri, 15 Jan 2016 21:18:25 +0000 (15:18 -0600)]
pvchange, pvresize: fix lockd_gl() usage

When an orphan PV is changed/resized, the
lvmlockd global lock is converted from sh
to ex. If the command is changing two
orphan PVs, the conversion to ex should
be done only once.

8 years agoreport: add kernel_cache_settings field
Peter Rajnoha [Mon, 18 Jan 2016 13:32:17 +0000 (14:32 +0100)]
report: add kernel_cache_settings field

Existing cache_settings field displays the settings which are
saved in metadata. Add new kernel_cache_settings fields to display
the settings which are currently used by kernel, including fields
for which default values are used.

This way users have complete view of the set of cache settings
supported (and which they can set) and their values which are used
at the moment by kernel.

For example:

$  lvs -o name,cache_policy,cache_settings,kernel_cache_settings vg
  LV      Cache Policy Cache Settings                               KCache Settings
  cached1 mq    migration_threshold=1024,write_promote_adjustment=2 migration_threshold=1024,random_threshold=4,sequential_threshold=512,discard_promote_adjustment=1,read_promote_adjustment=4,write_promote_adjustment=2
  cached2 smq   migration_threshold=1024                            migration_threshold=1024
  cached3 smq   migration_threshold=2048

8 years agopost-release
Alasdair G Kergon [Sat, 16 Jan 2016 02:12:10 +0000 (02:12 +0000)]
post-release

8 years agopre-release v2_02_140
Alasdair G Kergon [Sat, 16 Jan 2016 02:11:21 +0000 (02:11 +0000)]
pre-release

8 years agolvm2app: fix lvm2app to return either 0 or 1 for lvm_vg_is_{clustered,exported}
Peter Rajnoha [Fri, 15 Jan 2016 13:39:43 +0000 (14:39 +0100)]
lvm2app: fix lvm2app to return either 0 or 1 for lvm_vg_is_{clustered,exported}

Fix lvm2app to return either 0 or 1 for lvm_vg_is_{clustered,exported},
including internal functions pvseg_is_allocated and vg_is_resizeable
which are not yet exposed in lvm2app but make them consistent with the
rest.

8 years agolvmlockd: fixes for test mode
David Teigland [Thu, 14 Jan 2016 21:57:09 +0000 (15:57 -0600)]
lvmlockd: fixes for test mode

Get the test mode working (lvmlockd running with no
lock manager).

8 years agoRevert "lvmcache: skip drop when vg_write lock is not held"
David Teigland [Thu, 14 Jan 2016 19:26:15 +0000 (13:26 -0600)]
Revert "lvmcache: skip drop when vg_write lock is not held"

This reverts e28e22b9e1e4f7243608aa24ddf43ec63afd1751
The problem that that commit was fixing (pytest failure)
no longer appears with the current code, so the commit is
not needed.

That commit is a problem for pvchange, because it prevents
lvmcache from retaining VG metadata even while the global
lock is held.  pvchange holds the global lock to ensure
that VG metadata is kept in lvmcache throughout processing.
If the cache is not kept, a PV with zero MDAs will appear
first in its actual VG and then appear again in the orphan VG.
It wrongly appears a second time in the orphan VG only if
the actual VG is dropped from lvmcache.

8 years agoreport: add kernel_discards report field to display thin pool discard used in kernel
Peter Rajnoha [Thu, 14 Jan 2016 15:54:12 +0000 (16:54 +0100)]
report: add kernel_discards report field to display thin pool discard used in kernel

Thin pool discard mode set in metadata can be different from the one
actually used if any device underneath does not support that mode. Add
kernel_discard report field to make it possible to see this difference.

8 years agoRevert "process_each_pv: remove unnecessary workaround"
David Teigland [Thu, 14 Jan 2016 15:12:57 +0000 (09:12 -0600)]
Revert "process_each_pv: remove unnecessary workaround"

This reverts commit be1b1f3d8941543bcde2f42e65ed0f22fd07b122.

8 years agolvmanip: fix last commit and drop else
Zdenek Kabelac [Thu, 14 Jan 2016 10:54:37 +0000 (11:54 +0100)]
lvmanip: fix last commit and drop else

In last commit when removing if() branch
this 'else' now has to be dropped.

8 years agocleanup: order ac members
Zdenek Kabelac [Thu, 14 Jan 2016 10:21:47 +0000 (11:21 +0100)]
cleanup: order ac members

8 years agocleanup: spaces
Zdenek Kabelac [Mon, 11 Jan 2016 13:11:37 +0000 (14:11 +0100)]
cleanup: spaces

8 years agocleanup: replace log_warn
Zdenek Kabelac [Fri, 8 Jan 2016 10:08:07 +0000 (11:08 +0100)]
cleanup: replace log_warn

8 years agocleanup: explicit prohibition for virtual segs
Zdenek Kabelac [Wed, 6 Jan 2016 12:54:15 +0000 (13:54 +0100)]
cleanup: explicit prohibition for virtual segs

Internal _alloc_init() is only called from allocate_extents(),
which already does prevent usage of virtual segments.

So mark as internal error early and do not process it any further.

8 years agocleanup: simplier formula
Zdenek Kabelac [Fri, 8 Jan 2016 10:07:47 +0000 (11:07 +0100)]
cleanup: simplier formula

8 years agocleanup: more readable check
Zdenek Kabelac [Tue, 15 Dec 2015 14:13:11 +0000 (15:13 +0100)]
cleanup: more readable check

8 years agosnapshot: relocate alloc_snapshot_seg
Zdenek Kabelac [Thu, 7 Jan 2016 11:16:18 +0000 (12:16 +0100)]
snapshot: relocate alloc_snapshot_seg

Move alloc_snapshot_seg to snapshot_manip and make it local static.

8 years agosegtype: check for activation
Zdenek Kabelac [Thu, 17 Dec 2015 11:23:33 +0000 (12:23 +0100)]
segtype: check for activation

Before setting static variable with check passed state,
detect if we are allowed to talk to driver.

8 years agolvresize: check for poolmetadatasize arg earlier
Zdenek Kabelac [Wed, 16 Dec 2015 10:23:45 +0000 (11:23 +0100)]
lvresize: check for poolmetadatasize arg earlier

Since we check for poolmetadatasize, we need to detect it before
actual test.

8 years agolvmanip: add lv_is_snapshot
Zdenek Kabelac [Thu, 7 Jan 2016 13:30:21 +0000 (14:30 +0100)]
lvmanip: add lv_is_snapshot

Add new test for  lv_is_snapshot().
Also move few other bitchecks into same place as remaining bit tests.

TODO: drop lv_is_merging_origin() and keep using lv_is_merging().

8 years agovgcfgrestore: Retain allocatable PV attribute.
Alasdair G Kergon [Thu, 14 Jan 2016 00:46:45 +0000 (00:46 +0000)]
vgcfgrestore: Retain allocatable PV attribute.

pvchange -xn was getting lost.
All PVs were set to allocatable again after restore.

Moved setting ALLOCATABLE_PV outside pv_setup().

8 years agovgchange: fix lockd_gl results
David Teigland [Wed, 13 Jan 2016 21:55:41 +0000 (15:55 -0600)]
vgchange: fix lockd_gl results

The wrong error value was being checked from lockd_gl()
in two cases.

Clarify the use of lockd_gl() in the lock-start case.

8 years agolvmlockd: fix exit code
David Teigland [Wed, 13 Jan 2016 20:44:01 +0000 (14:44 -0600)]
lvmlockd: fix exit code

libdaemon uses 1 for success

8 years agoprocess_each_pv: remove unnecessary workaround
David Teigland [Wed, 13 Jan 2016 16:43:01 +0000 (10:43 -0600)]
process_each_pv: remove unnecessary workaround

The problem addressed by this workaround no longer
seems to exist, so remove it.  PVs with no mdas
no longer appear in both their actual VG and in
the orphan VG.

8 years agolv: fix check for NULL origin_lv in _do_lv_origin_dup, cleanup _do_lvconvert_lv_dup
Peter Rajnoha [Wed, 13 Jan 2016 16:11:00 +0000 (17:11 +0100)]
lv: fix check for NULL origin_lv in _do_lv_origin_dup, cleanup _do_lvconvert_lv_dup

8 years agocleanup: rename 'invisible devices' to 'hidden devices'
Peter Rajnoha [Wed, 13 Jan 2016 15:43:25 +0000 (16:43 +0100)]
cleanup: rename 'invisible devices' to 'hidden devices'

8 years agoconf: fix 'the volume list' vs 'volume list' and '@*'
Peter Rajnoha [Wed, 13 Jan 2016 14:47:26 +0000 (15:47 +0100)]
conf: fix 'the volume list' vs 'volume list' and '@*'

8 years agocleanup: rename 'invisible devices' to 'hidden devices'
Peter Rajnoha [Wed, 13 Jan 2016 14:37:15 +0000 (15:37 +0100)]
cleanup: rename 'invisible devices' to 'hidden devices'

8 years agocleanup: rename 'invisible devices' to 'hidden devices'
Peter Rajnoha [Wed, 13 Jan 2016 14:21:05 +0000 (15:21 +0100)]
cleanup: rename 'invisible devices' to 'hidden devices'

8 years agoWHATS_NEW: reports and invisible devices
Peter Rajnoha [Wed, 13 Jan 2016 13:45:49 +0000 (14:45 +0100)]
WHATS_NEW: reports and invisible devices

8 years agotest: add report-invisible.sh test
Peter Rajnoha [Wed, 13 Jan 2016 13:17:50 +0000 (14:17 +0100)]
test: add report-invisible.sh test

8 years agotests: update tests to deal with invisible devices consistently
Peter Rajnoha [Wed, 13 Jan 2016 12:55:24 +0000 (13:55 +0100)]
tests: update tests to deal with invisible devices consistently

8 years agocleanup: cleanup lv.h and put fns into categories for better readability
Peter Rajnoha [Tue, 12 Jan 2016 10:45:17 +0000 (11:45 +0100)]
cleanup: cleanup lv.h and put fns into categories for better readability

8 years agoconf: update command_profile_template.profile.in
Peter Rajnoha [Wed, 13 Jan 2016 11:15:28 +0000 (12:15 +0100)]
conf: update command_profile_template.profile.in

8 years agoconf: regenerate
Peter Rajnoha [Wed, 13 Jan 2016 10:58:12 +0000 (11:58 +0100)]
conf: regenerate

8 years agoconf: add report/mark_invisible_devices
Peter Rajnoha [Wed, 13 Jan 2016 10:30:07 +0000 (11:30 +0100)]
conf: add report/mark_invisible_devices

8 years agolv: use brackets for invisible devices when formatting device segments
Peter Rajnoha [Tue, 12 Jan 2016 13:49:56 +0000 (14:49 +0100)]
lv: use brackets for invisible devices when formatting device segments

Include brackets for the name if the dev is invisible.
This change applies to all callers of _format_pvsegs fn:
  - lvseg_devices (the "lvs -o devices")
  - lvseg_metadata_devices (the "lvs -o metadata_devices)
  - lvseg_seg_pe_ranges (the "lvs -o seg_pe_ranges")
  - lvseg_seg_metadata_le_ranges (the "lvs -o seg_metadata_le_ranges")

8 years agolv: add common lv_pool_lv fn for use in report and dup, use brackets for invisible...
Peter Rajnoha [Tue, 12 Jan 2016 10:53:39 +0000 (11:53 +0100)]
lv: add common lv_pool_lv fn for use in report and dup, use brackets for invisible devices

The common lv_pool_lv fn avoids code duplication and also
the reporting part now uses _lvname_disp and _uuid_disp to display
name and uuid respectively, including brackets for the name if the
dev is invisible.

8 years agolv: add common lv_metadata_lv fn for use in report and dup, use brackets for invisibl...
Peter Rajnoha [Tue, 12 Jan 2016 10:23:56 +0000 (11:23 +0100)]
lv: add common lv_metadata_lv fn for use in report and dup, use brackets for invisible devices

The common lv_metadata_lv fn avoids code duplication and also
the reporting part now uses _lvname_disp and _uuid_disp to display
name and uuid respectively, including brackets for the name if the
dev is invisible.

8 years agolv: add common lv_data_lv fn for use in report and dup, use brackets for invisible...
Peter Rajnoha [Tue, 12 Jan 2016 10:15:22 +0000 (11:15 +0100)]
lv: add common lv_data_lv fn for use in report and dup, use brackets for invisible devices

The common lv_data_lv fn avoids code duplication and also
the reporting part now uses _lvname_disp and _uuid_disp to display
name and uuid respectively, including brackets for the name if the
dev is invisible.

8 years agolv: add common lv_mirror_log_lv for use in report and dup, use brackets for invisible...
Peter Rajnoha [Tue, 12 Jan 2016 10:05:16 +0000 (11:05 +0100)]
lv: add common lv_mirror_log_lv for use in report and dup, use brackets for invisible devices

The common lv_mirror_log_lv fn avoids code duplication and also
the reporting part now uses _lvname_disp and _uuid_disp to display
name and uuid respectively, including brackets for the name if the
dev is invisible.

8 years agolv: add common lv_origin_lv fn for use in report and dup, use brackets for invisible...
Peter Rajnoha [Tue, 12 Jan 2016 09:52:34 +0000 (10:52 +0100)]
lv: add common lv_origin_lv fn for use in report and dup, use brackets for invisible devices

The common lv_origin_lv fn avoids code duplication and also
the reporting part now uses _lvname_disp and _uuid_disp to display
name and uuid respectively, including brackets for the name if the
dev is invisible.

8 years agolv: add common lv_convert_lv fn for use in report and dup, use brackets for invisible...
Peter Rajnoha [Tue, 12 Jan 2016 09:44:59 +0000 (10:44 +0100)]
lv: add common lv_convert_lv fn for use in report and dup, use brackets for invisible devices

The common lv_convert_lv fn avoids code duplication and also
the reporting part now uses _lvname_disp and _uuid_disp to display
name and uuid respectively, including brackets for the name if the
dev is invisible.

8 years agoman lvmlockd: mention pvmove restriction
David Teigland [Tue, 12 Jan 2016 18:01:53 +0000 (12:01 -0600)]
man lvmlockd: mention pvmove restriction

8 years agopvmove: disallow moving PVs under sanlock leases
David Teigland [Tue, 12 Jan 2016 17:51:12 +0000 (11:51 -0600)]
pvmove: disallow moving PVs under sanlock leases

Fail with an error message if pvmove tries to move PVs
under the lvmlock LV.

8 years agoreport: use proper string reference in _string_disp call for _cache_policy_disp fn
Peter Rajnoha [Tue, 12 Jan 2016 15:13:56 +0000 (16:13 +0100)]
report: use proper string reference in _string_disp call for _cache_policy_disp fn

8 years agotest: conditional skip of auto-activation bg polling test
Ondrej Kozina [Tue, 12 Jan 2016 12:24:12 +0000 (13:24 +0100)]
test: conditional skip of auto-activation bg polling test

if dm-snapshot-merge target not present skip whole test

8 years agovgchange: drop redundant check
Ondrej Kozina [Tue, 12 Jan 2016 09:15:10 +0000 (10:15 +0100)]
vgchange: drop redundant check

check for background polling option is performed from
within vgchange_background_polling routine as well.

8 years agotest: add test for autoactivation regression
Ondrej Kozina [Thu, 7 Jan 2016 14:30:22 +0000 (15:30 +0100)]
test: add test for autoactivation regression

add test for a regression fixed in
40701af9696a302c904fad30951385eb5a5adb85

8 years agopvscan: restore polling in autoactivation handler
Ondrej Kozina [Thu, 7 Jan 2016 14:17:08 +0000 (15:17 +0100)]
pvscan: restore polling in autoactivation handler

This commit fixes regression in auto-activation code introduced
in commit: c26d81d6e6939906729d91fae83cd8bbdd743bb7.

- resolves rhbz1295562

8 years agoreport: use brackets to signify LVs which are not visible when reporting lv_parent
Peter Rajnoha [Mon, 11 Jan 2016 14:34:35 +0000 (15:34 +0100)]
report: use brackets to signify LVs which are not visible when reporting lv_parent

Use common _lvname_disp to report lv_parent. The _lvname_disp
takes care of properly marking LVs which are not visible - such
LVs are always enclosed in brackets when reported within any
other field.

For example, thin pool over RAID.

Before:

$ lvs -a -o name,lv_parent,data_lv,metadata_lv vg
  LV                          Parent           Data               Meta
  cache_pool                                   [cache_pool_tdata] [cache_pool_tmeta]
  [cache_pool_tdata]          cache_pool
  [cache_pool_tdata_rimage_0] cache_pool_tdata
  [cache_pool_tdata_rimage_1] cache_pool_tdata
  [cache_pool_tdata_rmeta_0]  cache_pool_tdata
  [cache_pool_tdata_rmeta_1]  cache_pool_tdata
  [cache_pool_tmeta]          cache_pool
  [cache_pool_tmeta_rimage_0] cache_pool_tmeta
  [cache_pool_tmeta_rimage_1] cache_pool_tmeta
  [cache_pool_tmeta_rmeta_0]  cache_pool_tmeta
  [cache_pool_tmeta_rmeta_1]  cache_pool_tmeta
  [lvol0_pmspare]

With this patch applied:

$ lvs -a -o name,lv_parent,data_lv,metadata_lv vg
  LV                          Parent             Data               Meta
  cache_pool                                     [cache_pool_tdata] [cache_pool_tmeta]
  [cache_pool_tdata]          cache_pool
  [cache_pool_tdata_rimage_0] [cache_pool_tdata]
  [cache_pool_tdata_rimage_1] [cache_pool_tdata]
  [cache_pool_tdata_rmeta_0]  [cache_pool_tdata]
  [cache_pool_tdata_rmeta_1]  [cache_pool_tdata]
  [cache_pool_tmeta]          cache_pool
  [cache_pool_tmeta_rimage_0] [cache_pool_tmeta]
  [cache_pool_tmeta_rimage_1] [cache_pool_tmeta]
  [cache_pool_tmeta_rmeta_0]  [cache_pool_tmeta]
  [cache_pool_tmeta_rmeta_1]  [cache_pool_tmeta]
  [lvol0_pmspare]

8 years agocleanup: use _field_set_value and _string_disp consistently in report.c
Peter Rajnoha [Mon, 11 Jan 2016 14:01:35 +0000 (15:01 +0100)]
cleanup: use _field_set_value and _string_disp consistently in report.c

Do not mix dm_report_field_set_value and _field_set_value and
use single function call throughout for clarity. The same applies
for dm_report_field_string and _string_disp.

8 years agoreport: fix invalid memory read when reporting cache LV policy name
Peter Rajnoha [Mon, 11 Jan 2016 11:51:08 +0000 (12:51 +0100)]
report: fix invalid memory read when reporting cache LV policy name

Fix regression caused by commit c2d4330f27277717bc3b684b702189079b257b77
which removed the dm_pool_strdup for the cache policy name in
_cache_policy_disp report function.

This regression was hit with buffered reporting only (which is
used by default). The reason is that for buffered reporting, we're
iterating over LVs in VG (process_each_lv) while gathering
all the information that is needed for the report. In this case,
the LV's cache policy name has not been duped, but only the pointer
to the original VG buffer was stored. When the LV iteration finished,
the VG buffer was freed and any report to output called later
(dm_report_output call) accessed already freed VG data.

This didn't appear if unbuffered reporting was used (--unbuffered)
because in this case, the data were reported to output as
soon as they were processed, hence it was reported to output
before the VG data was freed.

8 years agopost-release
Alasdair G Kergon [Fri, 8 Jan 2016 18:51:08 +0000 (18:51 +0000)]
post-release

8 years agopre-release v2_02_139
Alasdair G Kergon [Fri, 8 Jan 2016 18:46:41 +0000 (18:46 +0000)]
pre-release

8 years agodocument commits since last release
David Teigland [Fri, 8 Jan 2016 15:53:58 +0000 (09:53 -0600)]
document commits since last release

8 years agoman: lvs: document F,D and M thin pool health status chars for lv_attr in lvs man...
Peter Rajnoha [Fri, 8 Jan 2016 14:47:01 +0000 (15:47 +0100)]
man: lvs: document F,D and M thin pool health status chars for lv_attr in lvs man page

8 years agolvmdump: also add lvm2-activation{-early,-net}.service systemd status for lvmdump -s
Peter Rajnoha [Mon, 4 Jan 2016 14:10:07 +0000 (15:10 +0100)]
lvmdump: also add lvm2-activation{-early,-net}.service systemd status for lvmdump -s

The lvm2-activation{-early,-net}.service systemd unit statuses were missing
in dump gathered by lvmdump -s. These are quite important when debugging
scenarios with systemd environment and where lvmetad is not used.

8 years agolvmlockd: update VG lock version earlier
David Teigland [Tue, 15 Dec 2015 22:14:49 +0000 (16:14 -0600)]
lvmlockd: update VG lock version earlier

Have commands send lvmlockd the update message
in vg_write instead of vg_commit, so that it's
not done while LVs are suspended.  If the vg_write
is not committed, and the seqno sent to lvmlockd
is not used, then lvmlockd can detect this when
the next update uses the same seqno.

8 years agovgrename: use process_each_vg
David Teigland [Tue, 1 Dec 2015 20:09:01 +0000 (14:09 -0600)]
vgrename: use process_each_vg

Use process_each_vg() to lock and read the old VG,
and then call the main vgrename code.

When real VG names are used (not a UUID in place of the
old name), the command still pre-locks the new name
(when strcmp wants it locked first), before calling
process_each_vg on the old name.

In the case where the old name is replaced with a UUID,
process_each_vg now translates that UUID into the real
VG name, which it locks and reads.  In this case, we
cannot do pre-locking to maintain lock ordering because
the old name is unknown.  So, in this case the strcmp
based lock ordering is suppressed and the old name is
always locked first.  This opens a remote chance for
lock ordering conflict between racing vgrenames between
two names where one or both commands use the UUID.

8 years agopvscan: Remove duplicate filter wipe.
Alasdair G Kergon [Mon, 14 Dec 2015 20:14:59 +0000 (20:14 +0000)]
pvscan: Remove duplicate filter wipe.

Also always clear the internal lvmcache after rescanning, and
reinstate a test for --trustcache so that 'pvs --trustcache'
(for example) avoids rescanning.

8 years agoprocess_each_pv: do full scan earlier to find new devices
David Teigland [Fri, 11 Dec 2015 20:02:36 +0000 (14:02 -0600)]
process_each_pv: do full scan earlier to find new devices

Before commit c1f246fedfc349c25749da501e68a7f70bd122b0,
_get_all_devices() did a full device scan before
get_vgnameids() was called.  The full scan in
_get_all_devices() is from calling dev_iter_create(f, 1).
The '1' arg forces a full scan.

By doing a full scan in _get_all_devices(), new devices
were added to dev-cache before get_vgnameids() began
scanning labels.  So, labels would be read from new devices.
(e.g. by the first 'pvs' command after the new device appeared.)

After that commit, _get_all_devices() was called
after get_vgnameids() was finished scanning labels.
So, new devices would be missed while scanning labels.
When _get_all_devices() saw the new devices (after
labels were scanned), those devices were added to
the .cache file.  This meant that the second 'pvs'
command would see the devices because they would be
in .cache.

Now, the full device scan is factored out of
_get_all_devices() and called by itself at the
start of the command so that new devices will
be known before get_vgnameids() scans labels.

8 years agopost-release
Alasdair G Kergon [Mon, 14 Dec 2015 12:25:48 +0000 (12:25 +0000)]
post-release

8 years agopre-release v2_02_138
Alasdair G Kergon [Mon, 14 Dec 2015 12:24:21 +0000 (12:24 +0000)]
pre-release

8 years agoChange messages from verbose to debug
David Teigland [Fri, 11 Dec 2015 21:28:46 +0000 (15:28 -0600)]
Change messages from verbose to debug

These messages about outdated PVs should not
be verbose because they always appear, even
when there are no outdated PVs.

8 years agocleanup: add missing WHATS_NEW
Zdenek Kabelac [Fri, 11 Dec 2015 19:13:20 +0000 (20:13 +0100)]
cleanup: add missing WHATS_NEW

8 years agotests: check lvrename of stacked cache pool
Zdenek Kabelac [Fri, 11 Dec 2015 19:11:11 +0000 (20:11 +0100)]
tests: check lvrename of stacked cache pool

8 years agofix static linking
Riku Voipio [Tue, 8 Dec 2015 14:40:08 +0000 (16:40 +0200)]
fix static linking

Static linking fails currently, as -lm and -lpthread are missing:

gcc -O2  -fPIC -O2  -L../libdm -L../lib -L../libdaemon/client -static
-L../libdm/ioctl \
      -o dmsetup.static dmsetup.o -ldevmapper    -lrt
../libdm/ioctl/libdevmapper.a(libdm-stats.o): In function
`dm_stats_create_region':
libdm-stats.c:(.text+0x2d69): undefined reference to `log10'
libdm-stats.c:(.text+0x2d6e): undefined reference to `lround'
../libdm/ioctl/libdevmapper.a(pool.o): In function `dm_pool_create':
pool.c:(.text+0x134): undefined reference to `pthread_mutex_lock'
pool.c:(.text+0x14f): undefined reference to `pthread_mutex_unlock'

Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
8 years agotests: fix logging
Zdenek Kabelac [Thu, 10 Dec 2015 19:47:30 +0000 (20:47 +0100)]
tests: fix logging

Actually  file redirection must be before stderr redir.

8 years agolvrename: always allow to rename pools
Zdenek Kabelac [Wed, 9 Dec 2015 12:52:47 +0000 (13:52 +0100)]
lvrename: always allow to rename pools

Since we mark cache-pool as 'hidden/private' while it is in-use,
we may still allow user to change it's name.

It should not cause any harm and user may prefer better naming
for a cache-pool in use.

8 years agocache: support stacked rename
Zdenek Kabelac [Mon, 7 Dec 2015 12:53:00 +0000 (13:53 +0100)]
cache: support stacked rename

Preserve skip_pool flag when running for_each_sub_lv() so
lvrename continues to work when thin-pool is using cached
data LV.

8 years agolvmlockd: reconnect to lvmetad if it's restarted
David Teigland [Thu, 10 Dec 2015 16:50:19 +0000 (10:50 -0600)]
lvmlockd: reconnect to lvmetad if it's restarted

If lvmetad is restarted after lvmlockd has connected
to it, then lvmlockd should reconnect.

8 years agolvrename: move the lvmlockd LV lock
David Teigland [Wed, 9 Dec 2015 17:51:25 +0000 (11:51 -0600)]
lvrename: move the lvmlockd LV lock

The function it was in is used for various
internal renaming of hidden LVs where a lock
from lvmlockd does not apply.

8 years agodmeventd: Don't trust fifo with wrong attrs.
Alasdair G Kergon [Tue, 8 Dec 2015 01:48:17 +0000 (01:48 +0000)]
dmeventd: Don't trust fifo with wrong attrs.

If an existing fifo has the wrong attributes it cannot be trusted
so we must unlink it and recreate it correctly.
(Replaces 2c8d6f5c90d5be62b48ba2881f2a6631091dc5af: if the other end of
the fifo already got opened while its mode was insecure, delaying the
chmod isn't going to make any difference!)

8 years agodmeventd: Extend checks on client socket.
Alasdair G Kergon [Tue, 8 Dec 2015 00:54:32 +0000 (00:54 +0000)]
dmeventd: Extend checks on client socket.

Reinstate and extend checks removed by e1b111b02accb4145b82b8b47ce57ed93b1a7184.

The code has always assumed that only root has access to the directory
containing the fifos and that they are under the complete control of
dmeventd code.  If anything is found not to be as expected, then open()
should certainly not be attempted!

8 years agopost-release
Alasdair G Kergon [Sat, 5 Dec 2015 15:36:22 +0000 (15:36 +0000)]
post-release

8 years agopre-release v2_02_137
Alasdair G Kergon [Sat, 5 Dec 2015 15:33:19 +0000 (15:33 +0000)]
pre-release

8 years agotests: extend test
Zdenek Kabelac [Fri, 4 Dec 2015 21:09:05 +0000 (22:09 +0100)]
tests: extend test

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