]> sourceware.org Git - lvm2.git/log
lvm2.git
9 years agodmsetup: use timerfd for interval timing if available dev-bmr-dmstats-timerfd
Bryn M. Reeves [Sat, 8 Aug 2015 22:59:06 +0000 (23:59 +0100)]
dmsetup: use timerfd for interval timing if available

If the Linux timerfd interface to POSIX timers is available at compile
time use it for all report interval timekeeping. This gives more
accurate interval timing when the per-interval processing time is less
than the configured interval and simplifies the timestamp bookkeeping
required to keep accurate time.

For systems without timerfd support fall back to the simple usleep based
timer.

9 years agolibdm: add dm_timestamp_copy()
Bryn M. Reeves [Fri, 7 Aug 2015 12:09:56 +0000 (13:09 +0100)]
libdm: add dm_timestamp_copy()

9 years agotests: keep testing mq policy
Zdenek Kabelac [Wed, 12 Aug 2015 12:18:28 +0000 (14:18 +0200)]
tests: keep testing mq policy

Tests were written for 'mq' policy, so disable smq.

9 years agotests: link some new cache profiles
Zdenek Kabelac [Mon, 20 Jul 2015 09:56:11 +0000 (11:56 +0200)]
tests: link some new cache profiles

9 years agocleanup: indent
Zdenek Kabelac [Tue, 21 Jul 2015 09:18:42 +0000 (11:18 +0200)]
cleanup: indent

9 years agocleanup: use IEC KiB units
Zdenek Kabelac [Thu, 16 Jul 2015 12:03:48 +0000 (14:03 +0200)]
cleanup: use IEC KiB units

Reduce mixing of KB, kiB and use just KiB.

9 years agolibdm: rename to data_block_size
Zdenek Kabelac [Tue, 11 Aug 2015 11:30:02 +0000 (13:30 +0200)]
libdm: rename to data_block_size

Use common name for pool device - as we use data_block_size
for thin pool metadata, use same name for cache_pool.

This change does not affect API.

9 years agolibdm: cache target arg validation
Zdenek Kabelac [Tue, 11 Aug 2015 11:31:26 +0000 (13:31 +0200)]
libdm: cache target arg validation

Add some arg validation for dm_tree_node_add_cache_target().

9 years agoconfig: extend definition for Allocation
Zdenek Kabelac [Thu, 23 Jul 2015 12:20:29 +0000 (14:20 +0200)]
config: extend definition for Allocation

Extend comment for this section.

9 years agoconfig: support longer config paths
Zdenek Kabelac [Thu, 23 Jul 2015 12:21:35 +0000 (14:21 +0200)]
config: support longer config paths

64 bytes might not be enough, so use larger buffer size.

9 years agocache: add more validation
Zdenek Kabelac [Tue, 11 Aug 2015 13:11:45 +0000 (15:11 +0200)]
cache: add more validation

9 years agocache: api update
Zdenek Kabelac [Tue, 11 Aug 2015 12:01:12 +0000 (14:01 +0200)]
cache: api update

Change logic and naming of some internal API functions.

cache_set_mode() and cache_set_policy() both take segment.

cache mode is now correctly 'masked-in'.

If the passed segment is 'cache' segment - it will automatically
try to find 'defaults' according to profiles if the are NOT
specified on command line or they are NOT already set for cache-pool.

These defaults are never set for cache-pool.

9 years agocache: undefined policy is mq
Zdenek Kabelac [Tue, 11 Aug 2015 13:19:00 +0000 (15:19 +0200)]
cache: undefined policy is mq

If the policy_name is unspecified in metadata,
it's automatically 'mq'.

9 years agotoollib: get_cache_params
Zdenek Kabelac [Thu, 23 Jul 2015 13:35:12 +0000 (15:35 +0200)]
toollib: get_cache_params

Enhance  get_cache_params() to read common cache args.

9 years agocache: man updates
Zdenek Kabelac [Mon, 20 Jul 2015 09:55:43 +0000 (11:55 +0200)]
cache: man updates

Better man for cachepolicy and cachesettings.

9 years agocache: runtime detect default policy
Zdenek Kabelac [Sun, 26 Jul 2015 21:05:11 +0000 (23:05 +0200)]
cache: runtime detect default policy

When the policy is not preset in lvm.conf,
detect in runtime whether to use 'mq' or
new available 'smq'.

9 years agocache: detect smq policy presence
Zdenek Kabelac [Thu, 23 Jul 2015 09:32:09 +0000 (11:32 +0200)]
cache: detect smq policy presence

Add code to detect available cache features.
Support policy_mq & policy_smq  features which might be disabled.

Introduce global_cache_disabled_features_CFG.

9 years agocache: introduce mq and smq profiles
Zdenek Kabelac [Mon, 20 Jul 2015 14:46:21 +0000 (16:46 +0200)]
cache: introduce mq and smq profiles

Add 2 demo profiles for mq and smq policies.
Show all support profilable params.

Use with: lvcreate --policy cache-mq ....

9 years agocache: add cache_policy cache_settings
Zdenek Kabelac [Mon, 20 Jul 2015 09:44:15 +0000 (11:44 +0200)]
cache: add cache_policy cache_settings

Add new profilable configurables:

allocation/cache_policy
allocation/cache_settings

and mark allocation/cache_pool_chunk_size as profilable as well.

Obsolete allocation/cache_pool_cachemode and
introduce new allocation/cache_mode instead.

Rename DEFAULT_CACHE_POOL_POLICY to DEFAULT_CACHE_POLICY.

9 years agoconfigure: --clear-need-check-flag needs 0.5.4
Zdenek Kabelac [Wed, 15 Jul 2015 14:08:02 +0000 (16:08 +0200)]
configure: --clear-need-check-flag needs 0.5.4

Require version 5.4 of cache_check tool where this option
will work correctly.

9 years agoudev: use += for SYSTEMD_WANTS instead of =
Thomas Bächler [Wed, 12 Aug 2015 07:29:04 +0000 (09:29 +0200)]
udev: use += for SYSTEMD_WANTS instead of =

Instead of using = to override SYSTEMD_WANTS, use += to add
the pvscan service.

9 years agolvconvert: fix lockd LV locking
David Teigland [Tue, 11 Aug 2015 17:12:22 +0000 (12:12 -0500)]
lvconvert: fix lockd LV locking

Request a transient LV lock from lvmlockd when
converting an LV.  If the LV is inactive when
lvconvert is run, the LV lock will be acquired
and then released when the command is done.
If the LV is active, a persistent lock exists
already and the transient lock request does nothing.

This fixes the issue that had been mentioned in the
comment previously.

9 years agolvrename: fix lockd LV locking
David Teigland [Mon, 10 Aug 2015 20:46:21 +0000 (15:46 -0500)]
lvrename: fix lockd LV locking

lvrename should not be done if the LV is active on another host.
This check was mistakenly removed when the code was changed to
use LV uuids in locks rather than LV names.

9 years agolvmlockd: add LV name to some debug logging
David Teigland [Mon, 10 Aug 2015 20:05:41 +0000 (15:05 -0500)]
lvmlockd: add LV name to some debug logging

The LV uuid is used as the lock name, and including
the LV name in some log messages makes it easier to
follow log messages.

9 years agolibdm-stats: backtrace if fclose fails (Coverity)
Bryn M. Reeves [Mon, 10 Aug 2015 18:23:41 +0000 (19:23 +0100)]
libdm-stats: backtrace if fclose fails (Coverity)

Since libdm-stats only uses fmemopen'd FILE objects the only way
that a close can fail is corruption of the memory containing the
FILE: check for this case and emit a backtrace if it occurs.

libdm/libdm-stats.c: 338 in _stats_parse_list()
libdm/libdm-stats.c: 341 in _stats_parse_list()
libdm/libdm-stats.c: 481 in _stats_parse_region()
libdm/libdm-stats.c: 487 in _stats_parse_region()
libdm/libdm-stats.c: 487 in _stats_parse_region()
 - Calling "fclose" without checking return value

9 years agolibdm: simplify stats nr_areas calculation (Coverity)
Bryn M. Reeves [Mon, 10 Aug 2015 18:18:16 +0000 (19:18 +0100)]
libdm: simplify stats nr_areas calculation (Coverity)

Remove an unneccessary conditional operator and simplify the logic
in _nr_areas:

libdm/libdm-stats.c: 501 in _nr_areas() - Control flow issues  (DEADCODE)

9 years agodmsetup: don't free handle if dm_stats_create fails (Coverity)
Bryn M. Reeves [Mon, 10 Aug 2015 18:05:10 +0000 (19:05 +0100)]
dmsetup: don't free handle if dm_stats_create fails (Coverity)

The error path of _stats_list frees the task and stats objects:
don't try to branch to it before they have been allocated.

tools/dmsetup.c: 4589 in _stats_help() - Null pointer dereferences  (FORWARD_NULL)

9 years agolibdm: fix stats handle leak in dm_stats_create (Coverity)
Bryn M. Reeves [Mon, 10 Aug 2015 09:15:22 +0000 (10:15 +0100)]
libdm: fix stats handle leak in dm_stats_create (Coverity)

Make sure the newly created handle is freed if we are unable to
also create the pool for it.

tools/dmsetup.c: 4255 in _stats_list() - Variable "dms" going out of scope leaks the storage it points to.

9 years agolibdm: fix FILE leak in _program_id_from_proc() (Coverity)
Bryn M. Reeves [Mon, 10 Aug 2015 09:08:03 +0000 (10:08 +0100)]
libdm: fix FILE leak in _program_id_from_proc() (Coverity)

Make sure comm is closed in the error path of _program_id_from_proc().

libdm/libdm-stats.c: 98 in dm_stats_create() - Variable "comm" going out of scope leaks the storage it points to.

9 years agodmsetup: remove bogus !_report test in _stats_report (Coverity)
Bryn M. Reeves [Mon, 10 Aug 2015 09:01:18 +0000 (10:01 +0100)]
dmsetup: remove bogus !_report test in _stats_report (Coverity)

There's no point testing _report here in _stats_report: it's always
initialised before the function is called and if the check did fail
we'd end up freeing an uninitialized dm_task in the error path.

tools/dmsetup.c: 4389 in _stats_report() - Declaring variable "dmt" without initializer.

9 years agolvmlockd: fix check for other sanlock lockspaces
David Teigland [Mon, 10 Aug 2015 18:16:04 +0000 (13:16 -0500)]
lvmlockd: fix check for other sanlock lockspaces

The check for other sanlock lockspaces was not checking
that the lockspace type was sanlock, so if dlm lockspaces
were visible, they were wrongly included.

9 years agovgremove: fix locking when lvmlockd global lock is removed
David Teigland [Mon, 10 Aug 2015 18:04:11 +0000 (13:04 -0500)]
vgremove: fix locking when lvmlockd global lock is removed

When vgremove is used to remove multiple VGs in one command,
e.g. vgremove foo bar, the first VG (foo) that is removed
may have held the sanlock global lock.  In this case,
do not continue removing further VGs (bar) without the
global lock.

9 years agopost-release
Alasdair G Kergon [Mon, 10 Aug 2015 00:02:31 +0000 (01:02 +0100)]
post-release

9 years agopre-release v2_02_127
Alasdair G Kergon [Sun, 9 Aug 2015 23:40:42 +0000 (00:40 +0100)]
pre-release

9 years agodmsetup: Also install dmstats.
Alasdair G Kergon [Sun, 9 Aug 2015 23:35:15 +0000 (00:35 +0100)]
dmsetup: Also install dmstats.

9 years agodmstats: add libdm-stats library and 'dmsetup stats' command
Bryn M. Reeves [Wed, 5 Aug 2015 09:40:00 +0000 (10:40 +0100)]
dmstats: add libdm-stats library and 'dmsetup stats' command

Add the libdm-stats module to libdm: this implements a simple interface
for creating, managing and interrogating I/O statistics regions and
areas on device-mapper devices.

The library interface is documented in libdevmapper.h and provides a
'dm_stats' handle that is used to perform statistics operations and
obtain data.

Public methods are provided to create and destroy handles and to list,
create, and destroy statistics regions as well as to obtain and parse
counter data and calculate rate-based metrics.

This commit also adds a 'dmsetup stats' (aka 'dmstats') command with
'clear', 'create', 'delete', 'list', 'print', and 'report' sub-commands.

See the library documentation and the dmstats.8 manual page for detailed
API and command descriptions.

9 years agoWHATS_NEW_DM: Update for preliminary stats commits
Bryn M. Reeves [Sat, 8 Aug 2015 16:37:07 +0000 (17:37 +0100)]
WHATS_NEW_DM: Update for preliminary stats commits

Add entries for dm_report_column_headings() and report row leaks
and remove the dm_report interval/wait entry.

9 years agolibdm: do not attempt to output column headings with --rows
Bryn M. Reeves [Sat, 8 Aug 2015 16:31:36 +0000 (17:31 +0100)]
libdm: do not attempt to output column headings with --rows

Columns-as-rows output does not use _report_headings(); don't
try to call it when rh->flags & DM_REPORT_OUTPUT_COLUMNS_AS_ROWS.

9 years agolibdm: remove report interval support
Bryn M. Reeves [Fri, 7 Aug 2015 15:15:21 +0000 (16:15 +0100)]
libdm: remove report interval support

Don't do interval management and external timekeeping for stats in
dm_report: let applications handle this on their own.

Since this has not been included in a release remove it from the
library entirely and handle report timing directly inside dmsetup.

9 years agolibdm: add dm_report_column_headings
Bryn M. Reeves [Fri, 7 Aug 2015 17:11:23 +0000 (18:11 +0100)]
libdm: add dm_report_column_headings

Add a function to print column headings regardless of whether they
have already been output. This will be used by dmstats to issue
periodic reminders of the column headings.

This patch removes a check for RH_HEADINGS_PRINTED from
_report_headings that prevents headings being displayed if the flag
is already set; this check is redundant since the only existing
caller (_output_as_columns()) already tests the flag before
calling the function.

9 years agolibdm: fix report rows and headings memory and state leaks
Bryn M. Reeves [Fri, 7 Aug 2015 16:08:54 +0000 (17:08 +0100)]
libdm: fix report rows and headings memory and state leaks

Not releasing objects back to the pool is fine for short-lived
pools since the memory will be freed when dm_pool_destroy() is
called.

Any pool that may be long-lived needs to be more careful to free
objects back to the pool to avoid leaking memory that will not be
reclaimed until the pool is destroyed at process exit time.

The report pool currently leaks each headings line and some row
data.

Although dm_report_output() tries to free the first allocated row
this may end up freeing a later row due to sorting of the row list
while reporting. Store a pointer to the first allocated row from
_do_report_obect() instead and free this at the end of
_output_as_columns(), _output_as_rows(), and dm_report_clear().

Also make sure to call dm_pool_free() for the headings line built
in _report_headings().

When dmstats is introduced it will maintain dm_report objects for
the whole lifetime of the process: without these changes a stats
report could leak around 600k in 10m (exact rate depends on field
selection and data values):

 top - 12:11:32 up 4 days,  3:16, 15 users,  load average: 0.01, 0.12, 0.14
  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
 6473 root      20   0  130196   3124   2792 S   0.0  0.0   0:00.00 dmstats

 top - 12:22:04 up 4 days,  3:26, 15 users,  load average: 0.06, 0.11, 0.13
  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
 6498 root      20   0  130836   3712   2752 S   0.0  0.0   0:00.60 dmstats

With this patch no increase in RSS is seen:

 top - 13:54:58 up 4 days,  4:59, 15 users,  load average: 0.12, 0.14, 0.14
  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
13962 root      20   0  130196   2996   2688 S   0.0  0.0   0:00.00 dmstats

 top - 14:04:31 up 4 days,  5:09, 15 users,  load average: 1.02, 0.67, 0.36
  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
13962 root      20   0  130196   2996   2688 S   0.3  0.0   0:00.32 dmstats

This also affects report output for repeating reports in the
DM_REPORT_OUTPUT_COLUMNS_AS_ROWS case; row state is not fully cleared for
the next iteration leading to progressive growth of the heading width:

vg_hex-lv_home:vg_hex-lv_swap:vg_hex-lv_root:luks-79733921-3f68-4c92-9eb7-d0aca4c6ba3e:vg_hex-lv_images
253:253:253:253:253
2:0:1:4:3
L--w:L--w:L--w:L--w:L--w
1:2:1:1:1
3:1:1:1:2
0:0:0:0:0
LVM-9t8ITqLZa6AuuyVoz5Olp1KwF9ZDBfOiv08BCGvF4WsJSqWUDUt7qtf2hEmjtVvo:LVM-9t8ITqLZa6AuuyVoz5Olp1KwF9ZDBfOiKf7XIiwdAYOJfaGhQe9fu26cTEICGgFS:LVM-9t8ITqLZa6AuuyVoz5Olp1KwF9ZDBfOiEZj7ZXbmrWDuGhd7vvi88VF0NdTMG8iA:CRYPT-LUKS1-797339213f684c929eb7d0aca4c6ba3e-luks-79733921-3f68-4c92-9eb7-d0aca4c6ba3e:LVM-9t8ITqLZa6AuuyVoz5Olp1KwF9ZDBfOi2rKredlBPnw2X7v1BiCuEpFo6gaE7BRw

:::::vg_hex-lv_home:vg_hex-lv_swap:vg_hex-lv_root:luks-79733921-3f68-4c92-9eb7-d0aca4c6ba3e:vg_hex-lv_images
:::::253:253:253:253:253
:::::2:0:1:4:3
:::::L--w:L--w:L--w:L--w:L--w
:::::1:2:1:1:1
:::::3:1:1:1:2
:::::0:0:0:0:0
:::::LVM-9t8ITqLZa6AuuyVoz5Olp1KwF9ZDBfOiv08BCGvF4WsJSqWUDUt7qtf2hEmjtVvo:LVM-9t8ITqLZa6AuuyVoz5Olp1KwF9ZDBfOiKf7XIiwdAYOJfaGhQe9fu26cTEICGgFS:LVM-9t8ITqLZa6AuuyVoz5Olp1KwF9ZDBfOiEZj7ZXbmrWDuGhd7vvi88VF0NdTMG8iA:CRYPT-LUKS1-797339213f684c929eb7d0aca4c6ba3e-luks-79733921-3f68-4c92-9eb7-d0aca4c6ba3e:LVM-9t8ITqLZa6AuuyVoz5Olp1KwF9ZDBfOi2rKredlBPnw2X7v1BiCuEpFo6gaE7BRw

9 years agolibdm: ensure new dm_timestamp objects are initialized
Bryn M. Reeves [Fri, 7 Aug 2015 12:10:34 +0000 (13:10 +0100)]
libdm: ensure new dm_timestamp objects are initialized

Allocate a dm_timestamp with dm_zalloc() to ensure the memory is
initialized to a known state.

9 years agoman: mention system ID in vgexport and vgimport
David Teigland [Fri, 7 Aug 2015 21:35:07 +0000 (16:35 -0500)]
man: mention system ID in vgexport and vgimport

9 years agoman: add lockd bits to relevant commands
David Teigland [Fri, 7 Aug 2015 21:25:00 +0000 (16:25 -0500)]
man: add lockd bits to relevant commands

9 years agoman lvmlockd: update
David Teigland [Fri, 7 Aug 2015 20:18:44 +0000 (15:18 -0500)]
man lvmlockd: update

9 years agoman lvmcache: mention LVs must be in the same VG
David Teigland [Thu, 6 Aug 2015 15:05:12 +0000 (10:05 -0500)]
man lvmcache: mention LVs must be in the same VG

9 years agolvmlockd: handle loss of sanlock lease storage
David Teigland [Fri, 31 Jul 2015 18:38:38 +0000 (13:38 -0500)]
lvmlockd: handle loss of sanlock lease storage

This adds the infrastructure, code paths, error reporting,
etc. to handle storage errors, or storage loss, under the
sanlock leases in a VG that is being used.  The loss of
storage means sanlock cannot renew its leases, which means
that the host needs to stop using the shared VG before its
leases expire.

This still requires manually shutting down a VG that has
lost lease storage, e.g. unmounting file systems,
deactivating LVs in the VG.  The next step is to
automatically use a command like blkdeactivate to do that.

9 years agodmsetup: Report timestamps of ioctls with -vvv.
Alasdair G Kergon [Wed, 5 Aug 2015 07:28:35 +0000 (08:28 +0100)]
dmsetup: Report timestamps of ioctls with -vvv.

If enabled, record timestamp immediately after the ioctl() returns.

9 years agolibdm: Whitespace.
Alasdair G Kergon [Wed, 5 Aug 2015 04:21:58 +0000 (05:21 +0100)]
libdm: Whitespace.

9 years agolibdm: Whitespace.
Alasdair G Kergon [Wed, 5 Aug 2015 04:11:42 +0000 (05:11 +0100)]
libdm: Whitespace.

9 years agolibdm: Sort new exported symbols.
Alasdair G Kergon [Wed, 5 Aug 2015 04:07:45 +0000 (05:07 +0100)]
libdm: Sort new exported symbols.

9 years agodmsetup: Tidy whitespace.
Alasdair G Kergon [Wed, 5 Aug 2015 04:03:33 +0000 (05:03 +0100)]
dmsetup: Tidy whitespace.

9 years agoman: document --nameprefixes
Peter Rajnoha [Tue, 4 Aug 2015 12:03:50 +0000 (14:03 +0200)]
man: document --nameprefixes

9 years agocoverity: check vg->lvm1_system_id is not NULL before calling strncmp with that
Peter Rajnoha [Tue, 4 Aug 2015 08:16:45 +0000 (10:16 +0200)]
coverity: check vg->lvm1_system_id is not NULL before calling strncmp with that

lib/format1/import-export.c:167: var_deref_model: Passing null pointer "vg->lvm1_system_id" to "strncmp", which dereferences it.

9 years agocoverity: variable init must be done before its use
Peter Rajnoha [Tue, 4 Aug 2015 07:51:16 +0000 (09:51 +0200)]
coverity: variable init must be done before its use

tools/polldaemon.c:465: uninit_use_in_call: Using uninitialized value "id.vg_name" when calling "print_log".
tools/polldaemon.c:465: uninit_use_in_call: Using uninitialized value "id.lv_name" when calling "print_log".

9 years agocoverity: return value check in lvmlockd-dlm
Peter Rajnoha [Tue, 4 Aug 2015 07:49:23 +0000 (09:49 +0200)]
coverity: return value check in lvmlockd-dlm

daemons/lvmlockd/lvmlockd-dlm.c:647: check_return: Calling "closedir" without checking return value (as is done elsewhere 13 out of 14 times).

9 years agocoverity: fix cppcheck warnings
Peter Rajnoha [Tue, 4 Aug 2015 07:33:55 +0000 (09:33 +0200)]
coverity: fix cppcheck warnings

/lib/log/log.c:88: warning[invalidScanfArgType_int]: %llu in format string (no. 2) requires 'unsigned long long *' but the argument type is 'long long *'.
daemons/lvmlockd/lvmlockd-core.c:791: error[uninitstring]: Dangerous usage of 'version' (strncpy doesn't always null-terminate it).

9 years agocoverity: fix possible resource leak in lvmpolld-core
Peter Rajnoha [Tue, 4 Aug 2015 07:25:40 +0000 (09:25 +0200)]
coverity: fix possible resource leak in lvmpolld-core

/daemons/lvmpolld/lvmpolld-core.c:573: leaked_storage: Variable "cmdargv" going out of scope leaks the storage it points to.

9 years agoreport: also recognize variants without underscores for <prefix>_all fields
Peter Rajnoha [Tue, 4 Aug 2015 07:03:31 +0000 (09:03 +0200)]
report: also recognize variants without underscores for <prefix>_all fields

For example: "pvs -o pv_all" and pvs -o pvall" are same.

9 years agolvmlockd: automatically remove the dlm global lockspace
David Teigland [Fri, 31 Jul 2015 21:45:43 +0000 (16:45 -0500)]
lvmlockd: automatically remove the dlm global lockspace

The dlm global lockspace is automatically added when the
first dlm VG lockspace is added.  Reverse this by removing
the dlm global lockspace after the last dlm VG lockspace
is removed.  (Remove old non-working code that did this
based on an old command that could explicitly add/remove
the dlm global lockspace.)

9 years agoreport: update comment for _is_same_field fn
Peter Rajnoha [Mon, 3 Aug 2015 14:47:02 +0000 (16:47 +0200)]
report: update comment for _is_same_field fn

9 years agoreport: recognize report field name variants without any underscores too
Peter Rajnoha [Mon, 3 Aug 2015 14:29:50 +0000 (16:29 +0200)]
report: recognize report field name variants without any underscores too

Whenver reporting field name is registered with libdevmapper and if
the field name contains any number of underscores ('_'), libdm
can now automatically recognize any of its variant without any
underscores used.

For example:

..for underscores in prefixes:
  pvs -o pv_name
  pvs -o name
  pvs -o pvname (newly recognized besides pvname)

..for underscores in the name:
  lvs -o cache_mode
  lvs -o cachemode

..or even multiple underscores:
  pvs -o pv___na___me

It's all variant of the same field name.

9 years agotoolcontext: do not set cmd->initialized_connections = 0 on destroy_toolcontext
Peter Rajnoha [Mon, 3 Aug 2015 14:17:09 +0000 (16:17 +0200)]
toolcontext: do not set cmd->initialized_connections = 0 on destroy_toolcontext

The whole cmd context is freed completely in destroy_toolcontext, so do
not write to any of dead cmd variables.

9 years agodmsetup: Use argcp and argvp.
Bryn M. Reeves [Fri, 31 Jul 2015 21:53:38 +0000 (22:53 +0100)]
dmsetup: Use argcp and argvp.

9 years agodmsetup: Add --count and --interval to reports.
Bryn M. Reeves [Fri, 31 Jul 2015 20:59:34 +0000 (21:59 +0100)]
dmsetup: Add --count and --interval to reports.

For example, to monitor active devices every second you can now run
dmsetup info -c --count 0.

9 years agolockd: remove ignorelockingfailure checks
David Teigland [Fri, 31 Jul 2015 20:46:51 +0000 (15:46 -0500)]
lockd: remove ignorelockingfailure checks

These code paths were effectively unused.  The checks
had been added long ago without any real thought behind
what they should do or be used for.

9 years agovgchange/lvchange: allow deactivation without locking
David Teigland [Fri, 31 Jul 2015 19:11:24 +0000 (14:11 -0500)]
vgchange/lvchange: allow deactivation without locking

If locking with lvmlockd has failed, allow LVs to be deactivated.

9 years agodmsetup: Allow commands to have subcommands.
Alasdair G Kergon [Fri, 31 Jul 2015 18:09:31 +0000 (19:09 +0100)]
dmsetup: Allow commands to have subcommands.

No commands set has_subcommands yet.

Move multiple device loop to separate function because we'll
soon want to call it repeatedly.

(Based on patch from bmr.)

9 years agodmsetup: Add subcommand parameter.
Alasdair G Kergon [Fri, 31 Jul 2015 16:47:03 +0000 (17:47 +0100)]
dmsetup: Add subcommand parameter.

Not yet used.
Allows for dmsetup stats <subcommand> dev1 dev2...

9 years agodmsetup: _find_command returns const
Alasdair G Kergon [Fri, 31 Jul 2015 15:58:14 +0000 (16:58 +0100)]
dmsetup: _find_command returns const

9 years agodmsetup: Add _dmsetup to help and usage fns.
Alasdair G Kergon [Fri, 31 Jul 2015 15:26:38 +0000 (16:26 +0100)]
dmsetup: Add _dmsetup to help and usage fns.

Prepare for dmstats.
Adjust some text to avoid 80-char wrap.

9 years agodmsetup: Rename _commands to _dmsetup_commands.
Alasdair G Kergon [Fri, 31 Jul 2015 15:13:45 +0000 (16:13 +0100)]
dmsetup: Rename _commands to _dmsetup_commands.

We'll need to accommodate sub-commands for dmstats.

9 years agotoolcontext: use refresh_filters in refresh_toolcontext
Peter Rajnoha [Fri, 31 Jul 2015 08:20:33 +0000 (10:20 +0200)]
toolcontext: use refresh_filters in refresh_toolcontext

Use refresh_filters instead of destroy_filters and init_filters
in refresh_toolcontext fn which deals with cmd->initialized.filters
correctly on refresh.

9 years agotest: Update Makefiles
Marian Csontos [Thu, 30 Jul 2015 18:23:14 +0000 (20:23 +0200)]
test: Update Makefiles

- Add missing check_lvmpolld to toplevel Makefile
- Document check_system

9 years agospec: lockd_dlm requires dlm-lib instead of dlm
Marian Csontos [Thu, 30 Jul 2015 18:19:35 +0000 (20:19 +0200)]
spec: lockd_dlm requires dlm-lib instead of dlm

9 years agolvmlockd: create sanlock lv large enough for existing lvs
David Teigland [Thu, 30 Jul 2015 17:04:31 +0000 (12:04 -0500)]
lvmlockd: create sanlock lv large enough for existing lvs

When changing an existing VG to lock_type sanlock,
make the sanlock lv large enough to hold all the
locks needed for existing LVs.

9 years agolvmlockd: small fixes and cleanup for lvmlockctl
David Teigland [Thu, 30 Jul 2015 15:47:41 +0000 (10:47 -0500)]
lvmlockd: small fixes and cleanup for lvmlockctl

. clean up the info output for readability
. remove some internal debug output
. fix the daemon quit option

9 years agocleanup: toolcontext: move report_list_item_separator into its group
Peter Rajnoha [Thu, 30 Jul 2015 14:14:10 +0000 (16:14 +0200)]
cleanup: toolcontext: move report_list_item_separator into its group

9 years agocleanup: toolcontext: make cmd_context more readable
Peter Rajnoha [Thu, 30 Jul 2015 14:01:02 +0000 (16:01 +0200)]
cleanup: toolcontext: make cmd_context more readable

Just shuffle the items and put them into logical groups so it's
visible at first sight what each group contains - it makes it a bit
easier to make heads and tails of the whole cmd_context monster.

9 years agocommands: add new NO_METADATA_PROCESSING flag to selected commands
Peter Rajnoha [Thu, 30 Jul 2015 08:48:28 +0000 (10:48 +0200)]
commands: add new NO_METADATA_PROCESSING flag to selected commands

When a command is flagged with NO_METADATA_PROCESSING flag, it means
such command does not process any metadata and hence it doens't require
lvmetad, lvmpolld and it can get away with no locking too. These are
mostly simple commands (like lvmconfig/dumpconfig, version, types,
segtypes and other builtin commands that do not process metadata
in any way).

At first, when lvm command is executed, create toolcontext without
initializing connections (lvmetad,lvmpolld) and without initializing
filters (which depend on connections init). Instead, delay this
initialization until we know we need this. That is, until the
lvm_run_command fn is called in which we know what the actual
command to run is and hence we can avoid any connection, filter
or locking initiliazation for commands that would not make use
of it anyway.

For all the other create_toolcontext calls, we keep the original
behaviour - the filters and connections are initialized together
with the toolcontext.

9 years agotoolcontext: add switches to create_toolcontext for connections and filters init
Peter Rajnoha [Thu, 30 Jul 2015 08:34:10 +0000 (10:34 +0200)]
toolcontext: add switches to create_toolcontext for connections and filters init

Make it possible to decide whether we want to initialize connections and
filters together with toolcontext creation.

Add "filters" and "connections" fields to struct
cmd_context_initialized_parts and set these in cmd_context.initialized
instance accordingly.

(For now, all create_toolcontext calls do initialize connections and
filters, we'll change that in subsequent patch appropriately.)

9 years agorefactor: toolcontext: move lvmetad and lvmpolld init into separate function
Peter Rajnoha [Thu, 30 Jul 2015 08:13:45 +0000 (10:13 +0200)]
refactor: toolcontext: move lvmetad and lvmpolld init into separate function

Move original lvmetad and lvmpolld initialization code from
_process_config fn to their own functions _init_lvmetad and
_init_lvmpolld (both covered with single _init_connections fn).

9 years agorefactor: toolcontext: add struct cmd_context_initialized_parts
Peter Rajnoha [Thu, 30 Jul 2015 07:59:39 +0000 (09:59 +0200)]
refactor: toolcontext: add struct cmd_context_initialized_parts

Add struct cmd_context_initialized_parts to wrap up information
about which cmd context pieces are initialized and add variable
of this struct type into struct cmd_context.

Also, move existing "config_initialized" variable that was directly
part of cmd_context into the new cmd_context.initialized wrapper.

We'll be adding more items into the struct cmd_context_initialized_parts
with subsequent patches...

9 years agovgremove: warn when removing sanlock global lock
David Teigland [Mon, 27 Jul 2015 19:51:43 +0000 (14:51 -0500)]
vgremove: warn when removing sanlock global lock

When the sanlock VG holding the global lock is removed,
print a warning indicating that the global needs to be
enabled in another sanlock VG.

9 years agovgcreate: improve checks for existing global lock
David Teigland [Fri, 24 Jul 2015 15:06:58 +0000 (10:06 -0500)]
vgcreate: improve checks for existing global lock

This tries harder to avoid creating duplicate global locks in
sanlock VGs by refusing to create a new sanlock VG with a
global lock if other sanlock VGs exist that may have a gl.

9 years agolvmcache: add lock_type to VG summary and info structs
David Teigland [Fri, 24 Jul 2015 20:20:37 +0000 (15:20 -0500)]
lvmcache: add lock_type to VG summary and info structs

vgsummary information contains provisional VG information
that is obtained without holding the VG lock.  This info
can be used to lock the VG, and then read it with vg_read().
After the VG is read properly, the vgsummary info should
be verified.

Add the VG lock_type to the vgsummary.  It needs to be
known before the VG can be locked and read.

9 years agolibdm: Require librt for new dm_timestamp.
Alasdair G Kergon [Wed, 29 Jul 2015 18:30:22 +0000 (19:30 +0100)]
libdm: Require librt for new dm_timestamp.

9 years agolibdm: Add dm_timestamp functions.
Alasdair G Kergon [Wed, 29 Jul 2015 18:21:07 +0000 (19:21 +0100)]
libdm: Add dm_timestamp functions.

9 years agodmsetup: Accept vg/lv name format.
Alasdair G Kergon [Wed, 29 Jul 2015 11:24:36 +0000 (12:24 +0100)]
dmsetup: Accept vg/lv name format.

If there is exactly one / which is not the first character, check
for /dev/vg/lv (as dm_dir()/../$name i.e. /dev/mapper/../vg/lv.)

9 years agodmsetup: remove dead code that covered "info -c -o help" case once
Peter Rajnoha [Wed, 29 Jul 2015 11:10:31 +0000 (13:10 +0200)]
dmsetup: remove dead code that covered "info -c -o help" case once

The "-o help" is now handled as implicit field and it gets processed
just like any other field - all handled by libdevmapper now.

9 years agocache: fix regression causing some PVs to bypass filters
Peter Rajnoha [Wed, 29 Jul 2015 07:43:03 +0000 (09:43 +0200)]
cache: fix regression causing some PVs to bypass filters

This is a regression introduced by commit
6c0e44d5a2e82aa160d48e83992e7ca342bc4bdf which changed
the way dev_cache_get fn works - before this patch, when a
device was not found, it fired a full rescan to correct the
cache. However, the change coming with that commit missed
this full_rescan call, causing the lvmcache to still contain
info about PVs which should be filtered now.

Such situation may have happened by coincidence of using
old persistent cache (/etc/lvm/cache/.cache) which does not
reflect the actual state anymore, a device name/symlink which
now points to a device which should be filtered and a fact we
keep info about usable DM devices in .cache no matter what
the filter setting is.

This bug could be hidden though by changes introduced in
commit f1a000a477558e157532d5f2cd2f9c9139d4f87c as it
calls full_rescan earlier before this problem is hit.
But we need to fix this anyway for the dev_cache_get
to be correct if we happen to use the same code path
again somewhere sometime.

For example, simple reproducer was (before commit
1a000a477558e157532d5f2cd2f9c9139d4f87c):

- /dev/sda contains a PV header with UUID y5PzRD-RBAv-7sBx-V3SP-vDmy-DeSq-GUh65M

- lvm.conf: filter = [ "r|.*|" ]

- rm -f .cache (to start with clean state)

- dmsetup create test --table "0 8388608 linear /dev/sda 0" (8388608 is
  just the size of the /dev/sda device I use in the reproducer)

- pvs (this will create .cache file which contains
  "/dev/disk/by-id/lvm-pv-uuid-y5PzRD-RBAv-7sBx-V3SP-vDmy-DeSq-GUh65M"
  as well as "/dev/mapper/test" and the target node "/dev/dm-1" - all the
  usable DM mappings (and their symlinks) get into the .cache file even
  though the filter "is set to "ignore all" - we do this - so far it's OK)

- dmsetup remove test (so we end up with /dev/disk/by-id/lvm-pv-uuid-...
  pointing to the /dev/sda now since it's the underlying device
  containing the actual PV header)

- now calling "pvs" with such .cache file and we get:
$ pvs
  PV                                                                 VG  Fmt  Attr PSize PFree
  /dev/disk/by-id/lvm-pv-uuid-y5PzRD-RBAv-7sBx-V3SP-vDmy-DeSq-GUh65M vg  lvm2 a--  4.00g    0

Even though we have set filter = [ "r|.*|" ] in the lvm.conf file!

9 years agolibdm: Add dm_size_to_string to libdevmapper.
Alasdair G Kergon [Mon, 27 Jul 2015 20:30:20 +0000 (21:30 +0100)]
libdm: Add dm_size_to_string to libdevmapper.

Moved out from lib/display and a little documentation added.
It's tuned to LVM's requirements historically and its behaviour
might not always be what you would expect.

9 years agolvmlockd: Drop -lrt now handled by configure.
Alasdair G Kergon [Mon, 27 Jul 2015 13:53:08 +0000 (14:53 +0100)]
lvmlockd: Drop -lrt now handled by configure.

9 years agoconfigure: Enable realtime by default, if present.
Alasdair G Kergon [Mon, 27 Jul 2015 13:44:58 +0000 (14:44 +0100)]
configure: Enable realtime by default, if present.

9 years agoconfigure: Add missing checks.
Alasdair G Kergon [Mon, 27 Jul 2015 13:26:56 +0000 (14:26 +0100)]
configure: Add missing checks.

9 years agogitignore: Update for in-place build.
Alasdair G Kergon [Mon, 27 Jul 2015 12:18:35 +0000 (13:18 +0100)]
gitignore: Update for in-place build.

9 years agopost-release
Alasdair G Kergon [Fri, 24 Jul 2015 22:39:54 +0000 (23:39 +0100)]
post-release

9 years agopost-release
Alasdair G Kergon [Fri, 24 Jul 2015 22:21:51 +0000 (23:21 +0100)]
post-release

9 years agopre-release v2_02_126
Alasdair G Kergon [Fri, 24 Jul 2015 22:20:42 +0000 (23:20 +0100)]
pre-release

9 years agotools: Streamline long option hyphen removal.
Alasdair G Kergon [Fri, 24 Jul 2015 18:45:49 +0000 (19:45 +0100)]
tools: Streamline long option hyphen removal.

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