]> sourceware.org Git - lvm2.git/log
lvm2.git
9 years agolibdm: fix bogus macro causing false parameter count
Heinz Mauelshagen [Thu, 24 Sep 2015 12:22:52 +0000 (14:22 +0200)]
libdm: fix bogus macro causing false parameter count

9 years agoraid: Fix raid target write_behind parameter.
Heinz Mauelshagen [Wed, 23 Sep 2015 14:53:27 +0000 (15:53 +0100)]
raid: Fix raid target write_behind parameter.

Now uses correct "max_write_behind" instead of "writebehind".
(Includes some tidying up.)

9 years agolibdm: Improve raid segment parameter handling.
Heinz Mauelshagen [Wed, 23 Sep 2015 14:25:46 +0000 (15:25 +0100)]
libdm: Improve raid segment parameter handling.

9 years agostyle: Miscellaneous tidying up of metadata/lv*
Heinz Mauelshagen [Wed, 23 Sep 2015 13:37:52 +0000 (14:37 +0100)]
style: Miscellaneous tidying up of metadata/lv*

9 years agosystemd: use {local,remote}-fs-pre.target instead of {local,remote}-fs.target
Peter Rajnoha [Wed, 23 Sep 2015 11:17:12 +0000 (13:17 +0200)]
systemd: use {local,remote}-fs-pre.target instead of {local,remote}-fs.target

We want most of our units to be started before any local/remote mount
points are mounted - we used {local,remote}-fs.target for this purpose
before, but it was not 100% correct as there's even {local,remote}-fs-pre.target
special systemd unit reserved for this exact purpose.

See also man 7 systemd.special and "local-fs-pre.target"/"remote-fs-pre.target"
description.

9 years agosegtypes: Make constants ULL.
Alasdair G Kergon [Tue, 22 Sep 2015 20:10:46 +0000 (21:10 +0100)]
segtypes: Make constants ULL.

9 years agoman lvmthin: use --poolmetadatasize option
David Teigland [Tue, 22 Sep 2015 18:44:09 +0000 (13:44 -0500)]
man lvmthin: use --poolmetadatasize option

when extending a pool metadata lv, rather than
referencing the _tmeta device.

9 years agosegtypes: Use SEG_TYPE_NAME_ string constants.
Alasdair G Kergon [Tue, 22 Sep 2015 18:04:12 +0000 (19:04 +0100)]
segtypes: Use SEG_TYPE_NAME_ string constants.

9 years agosegtypes: Extend flags to 64 bits.
Heinz Mauelshagen [Tue, 22 Sep 2015 17:03:33 +0000 (18:03 +0100)]
segtypes: Extend flags to 64 bits.

9 years agopost-release
Alasdair G Kergon [Tue, 22 Sep 2015 15:06:07 +0000 (16:06 +0100)]
post-release

9 years agopre-release v2_02_132
Alasdair G Kergon [Tue, 22 Sep 2015 15:00:10 +0000 (16:00 +0100)]
pre-release

9 years agoman: drop superfluous '--' in lvmconf man page for --enable/disable-halvm
Peter Rajnoha [Tue, 22 Sep 2015 12:27:40 +0000 (14:27 +0200)]
man: drop superfluous '--' in lvmconf man page for --enable/disable-halvm

9 years agolvmconf: set locking_type=2 if external library is requested
Peter Rajnoha [Tue, 22 Sep 2015 11:32:47 +0000 (13:32 +0200)]
lvmconf: set locking_type=2 if external library is requested

Also, set safe use_lvmetad=0 for external locking (locking_type=2)
similarly to locking_type=3.

9 years agowiping: warn if use_blkid_wiping=1 is set and LVM not compiled with blkid_wiping...
Peter Rajnoha [Tue, 22 Sep 2015 09:11:26 +0000 (11:11 +0200)]
wiping: warn if use_blkid_wiping=1 is set and LVM not compiled with blkid_wiping support

9 years agotests: update removal test
Zdenek Kabelac [Mon, 21 Sep 2015 20:44:43 +0000 (22:44 +0200)]
tests: update removal test

Test is currently checking a very non-standard use case.
Make it a more resistent against being blocked in kernel.

9 years agotests: check for block device
Zdenek Kabelac [Mon, 21 Sep 2015 20:42:43 +0000 (22:42 +0200)]
tests: check for block device

Need to detect if block device exist.

9 years agolvchange: update help text
Zdenek Kabelac [Mon, 21 Sep 2015 22:06:40 +0000 (00:06 +0200)]
lvchange: update help text

Use <> for user specified options.
(meant to match 'Italic' style in man page).

9 years agoman: update man pages
Zdenek Kabelac [Mon, 21 Sep 2015 20:45:47 +0000 (22:45 +0200)]
man: update man pages

Start to use 'italic' when the argument is not a fixed string.
Keep 'bold' when user cannot use any other string instead.

9 years agoclvmd: update help test
Zdenek Kabelac [Mon, 21 Sep 2015 20:40:49 +0000 (22:40 +0200)]
clvmd: update help test

Use <n> for <input> value.

9 years agolvmcache: Remove verbose msg when rescanning dev.
Alasdair G Kergon [Mon, 21 Sep 2015 18:51:15 +0000 (19:51 +0100)]
lvmcache: Remove verbose msg when rescanning dev.

9 years agoWHATS_NEW: commits cb8f29d1473d993d890387fe24331c9b9fe4713c - a54b4bba3578e371bb36ddb...
Peter Rajnoha [Mon, 21 Sep 2015 12:28:41 +0000 (14:28 +0200)]
WHATS_NEW: commits cb8f29d1473d993d890387fe24331c9b9fe4713c - a54b4bba3578e371bb36ddb3b040a71825a62814

9 years agoreport: add lv_convert_lv_uuid field
Peter Rajnoha [Mon, 21 Sep 2015 12:10:21 +0000 (14:10 +0200)]
report: add lv_convert_lv_uuid field

9 years agoreport: add lv_move_pv_uuid field
Peter Rajnoha [Mon, 21 Sep 2015 12:01:41 +0000 (14:01 +0200)]
report: add lv_move_pv_uuid field

9 years agopv: add 'mem' arg for pv_uuid_dup and pv_name_dup
Peter Rajnoha [Mon, 21 Sep 2015 11:38:53 +0000 (13:38 +0200)]
pv: add 'mem' arg for pv_uuid_dup and pv_name_dup

9 years agoreport: add lv_mirror_log_uuid field
Peter Rajnoha [Mon, 21 Sep 2015 11:16:48 +0000 (13:16 +0200)]
report: add lv_mirror_log_uuid field

9 years agoreport: add lv_data_lv_uuid field
Peter Rajnoha [Mon, 21 Sep 2015 11:07:28 +0000 (13:07 +0200)]
report: add lv_data_lv_uuid field

9 years agoreport: add lv_metadata_lv_uuid field
Peter Rajnoha [Mon, 21 Sep 2015 10:59:08 +0000 (12:59 +0200)]
report: add lv_metadata_lv_uuid field

9 years agoreport: add lv_origin_uuid field
Peter Rajnoha [Mon, 21 Sep 2015 10:44:29 +0000 (12:44 +0200)]
report: add lv_origin_uuid field

9 years agoreport: add lv_pool_lv_uuid field
Peter Rajnoha [Mon, 21 Sep 2015 10:28:58 +0000 (12:28 +0200)]
report: add lv_pool_lv_uuid field

9 years agolv: add 'mem' arg for lv_uuid_dup
Peter Rajnoha [Mon, 21 Sep 2015 10:23:03 +0000 (12:23 +0200)]
lv: add 'mem' arg for lv_uuid_dup

9 years agocleanup: report: reuse existing _uuid_disp fn to report pv_uuid field
Peter Rajnoha [Mon, 21 Sep 2015 09:34:03 +0000 (11:34 +0200)]
cleanup: report: reuse existing _uuid_disp fn to report pv_uuid field

9 years agotests: check dmsetup remove --force
Zdenek Kabelac [Fri, 18 Sep 2015 15:34:23 +0000 (17:34 +0200)]
tests: check dmsetup remove --force

9 years agotests: use remount-ro for extfs
Zdenek Kabelac [Fri, 18 Sep 2015 13:08:28 +0000 (15:08 +0200)]
tests: use remount-ro for extfs

Avoid showing kernel warn of umounting broken fs.

9 years agoman: use PD/HP for compressed lines
Zdenek Kabelac [Fri, 18 Sep 2015 14:15:54 +0000 (16:15 +0200)]
man: use PD/HP for compressed lines

Using .PD 0  to user zero spacing together with .HP is the best way
for condensed list of commands.

9 years agoman: enhance dmsetup/dmstats
Zdenek Kabelac [Fri, 18 Sep 2015 12:34:34 +0000 (14:34 +0200)]
man: enhance dmsetup/dmstats

Document more supported options.
Cleanup man-style when documenting options.
Use .PD 0  and .HP

9 years agodmsetup: improve help text
Zdenek Kabelac [Fri, 18 Sep 2015 12:37:50 +0000 (14:37 +0200)]
dmsetup: improve help text

Document more options.

9 years agodmsetup: use noflush with force removal
Zdenek Kabelac [Fri, 18 Sep 2015 12:35:52 +0000 (14:35 +0200)]
dmsetup: use noflush with force removal

When user specifies '--force' with remove/remove_all/wipe_table
use '--noflush --nolockfs' resume flags, so the operation
will not block when device underneath is blocked.

9 years agolibdm: parse Overflow string from snapshot status
Zdenek Kabelac [Fri, 18 Sep 2015 12:41:00 +0000 (14:41 +0200)]
libdm: parse Overflow string from snapshot status

This is likely to be a new 'info' provided by kernel
snapshot target.
For now just parse this string.

9 years agouuid: Report invalid character.
Heinz Mauelshagen [Fri, 18 Sep 2015 13:19:32 +0000 (14:19 +0100)]
uuid: Report invalid character.

9 years agoWHATS_NEW: commit 6c0b4a2769067048fa144814e298a3272564c475
Peter Rajnoha [Thu, 17 Sep 2015 12:36:39 +0000 (14:36 +0200)]
WHATS_NEW: commit 6c0b4a2769067048fa144814e298a3272564c475

9 years agolibdm: file: add proper checks for directory components in dm_create_dir
Peter Rajnoha [Thu, 17 Sep 2015 12:29:51 +0000 (14:29 +0200)]
libdm: file: add proper checks for directory components in dm_create_dir

Also make error messages more consistent:

Before this patch:

(/run/lock exists and is not a directory)
$ pvs
  /run/lock/lvm: mkdir failed: Not a directory
  File-based locking initialisation failed.

(/run/lock/lvm exists and is not a directory)
$ pvs
  Directory "/run/lock/lvm" not found
  File-based locking initialisation failed.

With this patch applied:

(/run/lock exists and is not a directory)
$ pvs
  Existing path /run/lock is not a directory.
  Failed to create directory /run/lock/lvm.
  File-based locking initialisation failed

(/run/lock/lvm exists and is not a directory)
$ pvs
  Existing path /run/lock/lvm is not a directory.
  Failed to create directory /run/lock/lvm.
  File-based locking initialisation failed.

9 years agolibdm: dev_node: use lstat instead of stat while removing and renaming nodes
Peter Rajnoha [Thu, 17 Sep 2015 11:31:34 +0000 (13:31 +0200)]
libdm: dev_node: use lstat instead of stat while removing and renaming nodes

When using udev, the /dev/mapper entries are symlinks - fix the code
to count with this.

This patch also fixes the dmsetup mknodes and vgmknodes to properly
repair /dev/mapper content if it sees dangling symlink in /dev/mapper.

9 years agolibdm: report: make it possible to use blank value as selection for string list repor...
Peter Rajnoha [Thu, 17 Sep 2015 08:19:15 +0000 (10:19 +0200)]
libdm: report: make it possible to use blank value as selection for string list report field

$ lvs -o name,tags vg
  LV    LV Tags
  lvol0
  lvol1 mytag

Before this patch:
$ lvs -o name,tags vg -S 'tags=""'
  Failed to parse string list value for selection field lv_tags.
  Selection syntax error at 'tags=""'.
  Use 'help' for selection to get more help.

(and the same for -S 'tags={}' and -S 'tags=[]')

With this patch applied:
$ lvs -o name,tags vg -S 'tags=""'
  LV    LV Tags
  lvol0

(and the same for -S 'tags={}' and -S 'tags=[]')

9 years agolvmlockd: unlock lv if command fails before lock completes
David Teigland [Wed, 16 Sep 2015 20:22:21 +0000 (15:22 -0500)]
lvmlockd: unlock lv if command fails before lock completes

If lvmlockd acquires an lv lock for a command, but the
command exits before the reply, then the command has
not activated the lv and lvmlockd should unlock it.
This only applies when the lv was not already locked.

(There will always be a chance that the lv lock is held
while the lv is not active, i.e. if the command fails in
the small window between getting the lv lock and before
doing the activation.  In that case, rerunning the
activation command corrects the inconsistency.)

This commit helps by automatically clearing the
inconsistency (lv locked by not activated) in the most
common case when the lv lock operation is slow to
complete and the command is canceled by the user.

This commit also adds and cleans up references to the
client id in a bunch of log messages, which is useful
to follow processing on each independent lock request.

9 years agoformat-text: label: fix missing dev assignment for struct label in _text_pv_write
Peter Rajnoha [Tue, 15 Sep 2015 15:38:02 +0000 (17:38 +0200)]
format-text: label: fix missing dev assignment for struct label in _text_pv_write

When using lvm shell, some structures which are cached in memory may be
reused. This happens for the struct label (a part of lvmcache_info
structure) when lvmetad is used in which case the PV scan is not
done that would normally overwrite these label structures in memory
and making them up-to-date.

This is all consequence of the fact that struct lvmcache_info and
struct label are not always assigned in the same part of the code.
For example, if lvmetad *is not* used, parts of the struct label are
reassigned in label_read fn while struct lvmcache_info is created
elsewhere. No part of the code reused struct label (and its "dev"
field) before calling label_read fn. That's why the real bug is
hidden when using lvm shell without lvmetad.

However, with lvmetad and lvm shell, the situation is a bit different.
The label_read fn is not called if lvmetad *is* used, hence the
struct label may have ended up not initialized properly.

There was missing assignment for the dev field in struct label
in _text_pv_write fn which caused this problem to appear in
lvm shell with lvmetad, for example:

Before this patch:

lvm> pvcreate /dev/sda
  Physical volume "/dev/sda" successfully created
lvm> pvs /dev/sda
  PV             VG     Fmt  Attr PSize   PFree
  unknown device        lvm2 ---  128.00m 128.00m

With this patch applied:

lvm> pvcreate /dev/sda
  Physical volume "/dev/sda" successfully created
lvm> pvs /dev/sda
  PV         VG   Fmt  Attr PSize   PFree
  /dev/sda        lvm2 ---  128.00m 128.00m

Also, this problem had not appeared before changes introduced
by commits e1a63905d14cc73352b905c70cb4084b7e521e33 through
3a6f91d7139119bea664050a957cbc21490398bc which, among other
things, added proper label field type reporting. Before, label
reporting was the same as using struct physical_volume which
has its own dev field assigned and so this problem was not exposed.

9 years agopost-release
Alasdair G Kergon [Tue, 15 Sep 2015 13:09:10 +0000 (14:09 +0100)]
post-release

9 years agopre-release v2_02_131
Alasdair G Kergon [Tue, 15 Sep 2015 12:17:50 +0000 (13:17 +0100)]
pre-release

9 years agoman: Add all_man Makefile target.
Alasdair G Kergon [Tue, 15 Sep 2015 12:14:16 +0000 (13:14 +0100)]
man: Add all_man Makefile target.

Use 'make all_man' to generate all man pages (regardless of
configuration options) or 'make install_all_man' to install them.

9 years agovgcreate: initialize new PVs only in first vg_write
David Teigland [Fri, 11 Sep 2015 21:12:03 +0000 (16:12 -0500)]
vgcreate: initialize new PVs only in first vg_write

When a command does a sequence of
vg_write + vg_commit + vg_write + vg_commit,

initialization of non-PV devices happens during the
first vg_write, and does not need to be repeated by
the second vg_write.

When creating a lockd VG, this sequence occurs because
the VG is first created, then the lockd data is created,
then the lockd data is then written to the VG metadata.

9 years agotests: early check for snapshot-merge
Zdenek Kabelac [Mon, 14 Sep 2015 09:02:48 +0000 (11:02 +0200)]
tests: early check for snapshot-merge

9 years agotests: lvextend of full thin pool
Zdenek Kabelac [Mon, 14 Sep 2015 18:09:21 +0000 (20:09 +0200)]
tests: lvextend of full thin pool

9 years agothin: show message on error path
Zdenek Kabelac [Mon, 14 Sep 2015 10:58:21 +0000 (12:58 +0200)]
thin: show message on error path

Add missing log_error and show proper reason for failure
when autoextend is set to 0.

Add missing log_error when checked LV is not locally active.

9 years agolibdm: no validate for pool without messages
Zdenek Kabelac [Mon, 14 Sep 2015 12:59:40 +0000 (14:59 +0200)]
libdm: no validate for pool without messages

Avoid validation of free space in pool, when no messages are passed.

Patch a3c7e326c3e9950fe74e433c406d6e1b5a53bf25 add new check for
pool overload - but this check should not be made if there are
no messages and transaction_id is still within 'bounds' (bigger by 1).

9 years agovgimporeclone: use correct cache dir path
Zdenek Kabelac [Mon, 14 Sep 2015 07:24:15 +0000 (09:24 +0200)]
vgimporeclone: use correct cache dir path

Commit 00b36ef06acb15c82d7c9b37872753f02c638316 had a typo
and missed '{' for shell variable, thus command used slightly
different 'tmp' dir name for cache dir (with extra '}').

Such change was unnoticed until a recent fix in persistent
filter, lvm2 missed to update cache file when --config
was specified.

The result was, /tmp dir was accumulating snap.XXXXX} dirs when
running vgimportclose  script.

9 years agotests: wait for sync before deactivation
Zdenek Kabelac [Fri, 11 Sep 2015 18:54:43 +0000 (20:54 +0200)]
tests: wait for sync before deactivation

On slower machine/disk, sync may block udev from reading and may prevent
deactivation.

9 years agotests: new thin tests
Zdenek Kabelac [Fri, 11 Sep 2015 19:00:10 +0000 (21:00 +0200)]
tests: new thin tests

9 years agomakefiles: distclean missing files
Zdenek Kabelac [Fri, 11 Sep 2015 19:30:45 +0000 (21:30 +0200)]
makefiles: distclean missing files

9 years agopool: validate pool_metadata has proper suffix
Zdenek Kabelac [Fri, 11 Sep 2015 18:58:58 +0000 (20:58 +0200)]
pool: validate pool_metadata has proper suffix

9 years agothin: improve swapping of identifiers
Zdenek Kabelac [Fri, 11 Sep 2015 18:56:53 +0000 (20:56 +0200)]
thin: improve swapping of identifiers

Since we may want to swap names when LVs are complex types, we cannot
avoid doing full renames on both LV stacks.
Temporarily use 'pvmove_tmeta' as unused name to prevent validation troubles.

9 years agothin: lvconvert use passed PVs for _pmspare
Zdenek Kabelac [Fri, 11 Sep 2015 18:56:02 +0000 (20:56 +0200)]
thin: lvconvert use passed PVs for _pmspare

When PVs are given on 'lvconvert' respect them when converting
volume to thin-pool and allocating i.e. _pmspare.

9 years agoconfigure: relocate configure.h
Zdenek Kabelac [Fri, 11 Sep 2015 19:30:05 +0000 (21:30 +0200)]
configure: relocate configure.h

Commit 9403edbb93a2c337df790408e9ff3d26566b7443 move location of
configure.h and lvm-version.h.

Let's try even better place then /conf dir which should be left
for user configurable files.

Put these files right into include dir.

9 years agoconfigure: correct message
Zdenek Kabelac [Fri, 11 Sep 2015 19:16:31 +0000 (21:16 +0200)]
configure: correct message

9 years agoman lvmlockd: move and update text about vgremove
David Teigland [Fri, 11 Sep 2015 19:34:22 +0000 (14:34 -0500)]
man lvmlockd: move and update text about vgremove

The requirement to stop VGs before vgremove applies
to both sanlock and dlm VGs.

9 years agolvmlockd: prevent vgremove of dlm VG while lockspace is used
David Teigland [Fri, 11 Sep 2015 19:06:46 +0000 (14:06 -0500)]
lvmlockd: prevent vgremove of dlm VG while lockspace is used

This applies the same rule/logic to dlm VGs that has always
existed for sanlock VGs.  Allowing a dlm VG to be removed
while its lockspace was still running on other hosts largely
worked, but there were difficult problems if another VG with
the same name was recreated.  Forcing the VG lockspace to
be stopped, gives both sanlock and dlm VGs the same behavior.

9 years agolvmlockd: remove shortcut for lockspace thread cleanup
David Teigland [Thu, 10 Sep 2015 15:33:45 +0000 (10:33 -0500)]
lvmlockd: remove shortcut for lockspace thread cleanup

This shortcut was added for an odd case that I do not
believe is relevant any more.  Having an alternate
path for lockspace thread cleanup is a complication
that could lead to problems.

9 years agolvmlockd: optimize dlm global lockspace creation
David Teigland [Thu, 10 Sep 2015 15:31:25 +0000 (10:31 -0500)]
lvmlockd: optimize dlm global lockspace creation

Set a flag indicating that the dlm global lockspace
exists to avoid going through the entire process of
trying to add it before finding it exists.

9 years agolockd: fix rescanning VG metadata
David Teigland [Fri, 11 Sep 2015 18:08:59 +0000 (13:08 -0500)]
lockd: fix rescanning VG metadata

The code was expecting the wrong return value from
compare_config, which returns 0 when equal.

This is a problem for a lockd VG using multiple PVs
when the VG needs to be rescanned.

9 years agospec: upgrade
Zdenek Kabelac [Wed, 9 Sep 2015 13:59:32 +0000 (15:59 +0200)]
spec: upgrade

Upgrade spec rules to be in touch with recent code.
Provide services and proper postin/preun/postun scriplets.

9 years agotests: remove only existing loops
Zdenek Kabelac [Wed, 9 Sep 2015 07:40:17 +0000 (09:40 +0200)]
tests: remove only existing loops

If loop device meanwhile dissapered, skip 'losetup -d' call.

9 years agotests: fix check lv_not_exist
Zdenek Kabelac [Thu, 10 Sep 2015 15:19:30 +0000 (17:19 +0200)]
tests: fix check lv_not_exist

Use 'not' to set proper 'expected return status'
so we do not 'leak' debug logs printed for failing case.

9 years agotests: check cache stripe and raid behavior
Zdenek Kabelac [Thu, 10 Sep 2015 14:54:40 +0000 (16:54 +0200)]
tests: check cache stripe and raid behavior

Somehow raid tests landed in plain cache - separte them out
so they properly check for  have_raid.

Check we do not support strip option with cache-pool creation.

9 years agocache: disallow stripes/size for cache pool
Zdenek Kabelac [Thu, 10 Sep 2015 14:33:11 +0000 (16:33 +0200)]
cache: disallow stripes/size for cache pool

ATM allocation can't handle stripping and cache pool allocation.
It's not yet even clear what should be actually result.
Until resolved, disable this option (it's been coredumping
inside allocation anyway).

9 years agocache: warn if caching causes troubles
Zdenek Kabelac [Thu, 10 Sep 2015 13:07:59 +0000 (15:07 +0200)]
cache: warn if caching causes troubles

Certain stacks of cached LVs may have unexpected consequences.
So add a warning function called when LV is cached to detect
such caces and WARN user about them - the best we could do ATM.

9 years agolib: when moving segtypes, move LV bits
Zdenek Kabelac [Thu, 10 Sep 2015 13:08:29 +0000 (15:08 +0200)]
lib: when moving segtypes, move LV bits

When we insert layer we also move status flag-bits for certain LV types,
so internal volume_group structure remains consistent.
(Perhaps it's misuse of 'insert_layer' function and we should have
another similar function for this.)

Basically we aim to maintain the same state as after reading fresh
metadata out of volume group.

Currently we when i.e. cache  'raid' LV - this should transfer 'raidLV' flag
to  _corigin LV and cache is no longer a raid.

TODO: bits for stacked devices needs more exact rules.

9 years agolvmlockd: check all variations of lvb values
David Teigland [Wed, 9 Sep 2015 19:40:48 +0000 (14:40 -0500)]
lvmlockd: check all variations of lvb values

The dlm will often lose the lvb content, so we need to
check quite a few possibilities for lvb values that
were not being checked before.

Refactoring was required to pass the entire lvb value
back to the core code instead of the single value.

The only functional change should be detecting new
lvb states where metadata is now invalidated where
it wasn't before.

9 years agolvmlockd: flag for internal actions
David Teigland [Wed, 9 Sep 2015 18:33:10 +0000 (13:33 -0500)]
lvmlockd: flag for internal actions

When an action is created by lvmlockd for itself,
there is no client to send the result to.  Add
the NO_CLIENT flag to the action to skip sending
the result to a client.

9 years agolvmlockd: rename ADOPT_CLIENT_ID
David Teigland [Wed, 9 Sep 2015 18:25:39 +0000 (13:25 -0500)]
lvmlockd: rename ADOPT_CLIENT_ID

to INTERNAL_CLIENT_ID since it will be
used for more than adopting locks.

9 years agolockd: add start_init arg to lockd_start_vg
David Teigland [Wed, 9 Sep 2015 18:20:37 +0000 (13:20 -0500)]
lockd: add start_init arg to lockd_start_vg

Add a new arg to lockd_start_vg() that indicates
it is being called for a new lockd VG, so that
lvmlockd knows the lockspace being started is new.
(Will be used by a following commit.)

9 years agovgchange: lock-stop only needs shared lock
David Teigland [Wed, 9 Sep 2015 18:09:17 +0000 (13:09 -0500)]
vgchange: lock-stop only needs shared lock

lock-stop is one of the vgchange options that
doesn't change the VG so we can override the
default ex lock and use sh.

9 years agodev-cache: ignore persistent cache if configuration changed
Peter Rajnoha [Thu, 10 Sep 2015 14:00:14 +0000 (16:00 +0200)]
dev-cache: ignore persistent cache if configuration changed

Commit f6473baffc2d0b486b2aa941cf2681683026b3a5 introduced a new
cmd->initialized variable to keep info about which parts of the
cmd_context have been initialized.

A part of this patch was also a change in refresh_filters fn
which checks for cmd->initialized.filters variable and it does
the filter refresh *only* if the filter has already been initialized
before otherwise it's a NOOP (before, the refresh_filters also
initialized filters as a side effect in case it had not been
initialized before which was not quite correct).

However, the commit f6473baffc2d0b486b2aa941cf2681683026b3a5
did not handle the case in which configuration changes
either via --config argument or when configuration file changed
and its timestamp was higher than the timestamp of the persistent
cache file - the /etc/lvm/cache/.cache.

This patch fixes this issue and it causes the init_filters fn
in lvm_run_command fn to be called with proper value of
"load_persistent_cache" switch even if the configuration changes,
hence causing the persistent cache file to be ignored in this
case.

9 years agoman lvmlockd: fix typo
David Teigland [Wed, 9 Sep 2015 20:43:28 +0000 (15:43 -0500)]
man lvmlockd: fix typo

9 years agoman lvmlockd: mention device used for first vgcreate
David Teigland [Wed, 9 Sep 2015 20:21:10 +0000 (15:21 -0500)]
man lvmlockd: mention device used for first vgcreate

9 years agotests: ensure dd flushed all data before exit
Zdenek Kabelac [Tue, 8 Sep 2015 12:11:46 +0000 (14:11 +0200)]
tests: ensure dd flushed all data before exit

9 years agotests: better check for compiled version
Zdenek Kabelac [Tue, 8 Sep 2015 12:11:06 +0000 (14:11 +0200)]
tests: better check for compiled version

Use install /lib files to check for expected version.

9 years agomakefiles: ensure no old .h are left
Zdenek Kabelac [Tue, 8 Sep 2015 12:33:29 +0000 (14:33 +0200)]
makefiles: ensure no old .h are left

Ensure make clean  cleans any left-over file from their previous
location so they are not in conflict with new ones.

Also hide error message when .commands file is not present.

9 years agoWHATS_NEW: commit b77497cbd86a854add3ffa4ce09a35f165c0d2ba
Peter Rajnoha [Tue, 8 Sep 2015 13:37:23 +0000 (15:37 +0200)]
WHATS_NEW: commit b77497cbd86a854add3ffa4ce09a35f165c0d2ba

9 years agofilters: make sure regex filter is evaluated before any filter that needs disk access
Peter Rajnoha [Tue, 8 Sep 2015 13:03:15 +0000 (15:03 +0200)]
filters: make sure regex filter is evaluated before any filter that needs disk access

The regex filter (controlled by devices/filter lvm.conf setting) was
evaluated as the very last filter. However, this is not optimal when
it comes to restricting disk access - users define devices/filter
as well as devices/global_filter to avoid this.

The devices/global_filter is already positioned at the beginning of the
filter chain. We need to do the same for devices/filter.

Filter chains before this patch:

  A: when lvmetad is not used:
       persistent_filter -> sysfs_filter -> global_regex_filter ->
       type_filter -> usable->filter -> mpath_component_filter ->
       partition_filter -> md_component_filter -> fw_raid_filter ->
       regex_filter

  B: when lvmetad is used:

    B1: to update lvmetad:
      sysfs_filter -> global_regex_filter -> type_filter ->
      usable_filter -> mpath_component_filter -> partition_filter ->
      md_component_filter -> fw_raid_filter

    B2: to retrieve info from lvmetad:
      persistent_filter -> usable_filter -> regex_filter

From the chain list above we can see that particularly in case when
lvmetad is not used, the regex filter is the very last one that is
processed. If lvmetad is used, it doesn't matter much as there's
the global_regex_filter which is used instead when updating lvmetad
and when retrieving info from lvmetad, putting regex_filter in front
of usable_filter wouldn't change much since usabled_filter is not
reading disks directly.

This patch puts the regex filter to the front even in case lvmetad
is not used, hence reinstating the state as it was before commit
a7be3b12dfe7388d1648595e6cc4c7a1379bb8a7 (which moved the regex_filter
position in the chain). Still, the arguments for the commit
a7be3b12dfe7388d1648595e6cc4c7a1379bb8a7 still apply and they're
still satisfied since component filters (MD, mpath...) are evaluated
first just before updating lvmetad.

So with this patch, we end up with:

  A: when lvmetad is not used:
       persistent_filter -> sysfs_filter -> global_regex_filter ->
       regex_filter -> type_filter -> usable->filter ->
       mpath_component_filter -> partition_filter ->
       md_component_filter -> fw_raid_filter

  B: when lvmetad is used:

    B1: to update lvmetad:
      sysfs_filter -> global_regex_filter -> type_filter ->
      usable_filter -> mpath_component_filter -> partition_filter ->
      md_component_filter -> fw_raid_filter

    B2: to retrieve info from lvmetad:
      persistent_filter -> regex_filter -> usable_filter

This way, specifying the regex_filter in non-lvmetad case causes
the devices to be filtered based on regex first before processing
any other filters which can access disks (like md_component_filter).

This patch also streamlines the code for better readability.

9 years agotests: skip raid testing on 4.[1,2] fc24 kernels
Zdenek Kabelac [Tue, 8 Sep 2015 10:00:12 +0000 (12:00 +0200)]
tests: skip raid testing on 4.[1,2] fc24 kernels

Hopefull 4.3 will be fixed and test will be updated to let
raid test running again.

Meanwhile using md-raid may effectively kill kernel,
so leave at least other tests running.

9 years agospecs: install lvmlockctl only when built
Zdenek Kabelac [Mon, 7 Sep 2015 21:27:50 +0000 (23:27 +0200)]
specs: install lvmlockctl only when built

Move install line into proper section.

9 years agolibdm: clean up stats local variable use
Bryn M. Reeves [Mon, 7 Sep 2015 19:08:10 +0000 (20:08 +0100)]
libdm: clean up stats local variable use

9 years agolibdm: fix display of nsec suffixes in histogram strings
Bryn M. Reeves [Mon, 7 Sep 2015 19:11:28 +0000 (20:11 +0100)]
libdm: fix display of nsec suffixes in histogram strings

9 years agolibdm: clean up _build_histogram_arg()
Bryn M. Reeves [Mon, 7 Sep 2015 17:27:22 +0000 (18:27 +0100)]
libdm: clean up _build_histogram_arg()

Split up _build_histogram_arg() into separate functions to allocate
and fill the histogram arg string and remove nested local variable
declarations from the parent function.

9 years agolibdm: only free the first histogram explicitly (Coverity)
Bryn M. Reeves [Mon, 7 Sep 2015 16:53:56 +0000 (17:53 +0100)]
libdm: only free the first histogram explicitly (Coverity)

Coverity flags a user-after-free in _stats_histograms_destroy():

>>>     Calling "dm_pool_free" frees pointer "mem->chunk" which has
>>>     already been freed.

This should not be possible since the histograms are destroyed in
reverse order of allocation:

 203         for (n = _nr_areas_region(region) - 1; n; n--)
 204                 if (region->counters[n].histogram)
 205                         dm_pool_free(mem, region->counters[n].histogram);

It appears that Coverity is unaware that pool->chunk is updated
during the call to dm_pool_free() and valgrind flags no errors in
this function when called with multiple allocated histograms.

Since there is no actual need to free the histograms individually
in this way simplify the code and just free the first allocated
object (which will also free all later allocated histograms in a
single call).

9 years agocleanup: assign seg_name once
Zdenek Kabelac [Fri, 4 Sep 2015 07:42:45 +0000 (09:42 +0200)]
cleanup: assign seg_name once

9 years agospecs: package lvmlockctl man page
Zdenek Kabelac [Mon, 7 Sep 2015 14:40:46 +0000 (16:40 +0200)]
specs: package lvmlockctl man page

9 years agotests: update install rules
Zdenek Kabelac [Fri, 4 Sep 2015 14:34:34 +0000 (16:34 +0200)]
tests: update install rules

Enhnace 'make install' rules for test suite (used for rpm packaging).
Install lvmlockd conf files.
Compile runner with correct CXXFLAGS.

9 years agomakefiles: do not generate tags for everyone
Zdenek Kabelac [Mon, 7 Sep 2015 11:44:14 +0000 (13:44 +0200)]
makefiles: do not generate tags for everyone

Create tags file only on request (make tags).
Also clean file with 'make clean'.

9 years agomakefiles: deps depends on header links
Zdenek Kabelac [Mon, 7 Sep 2015 12:00:27 +0000 (14:00 +0200)]
makefiles: deps depends on header links

Put include/.symlinks_created as a prerequisite for dep calc.
Otherwise if these are not generated and user enters tests subdir and
runs 'make' he just gets endless loop of dep calculation.

9 years agoconfigure: regenerate
Zdenek Kabelac [Mon, 7 Sep 2015 12:02:25 +0000 (14:02 +0200)]
configure: regenerate

9 years agoconfigure: simpler version reading
Zdenek Kabelac [Mon, 7 Sep 2015 11:58:54 +0000 (13:58 +0200)]
configure: simpler version reading

Avoid calling 'cat' when 'read' could handle it.

Also drop DM_LIB_VERSION from AC_SUBST as it's not used anywhere
in .in file.

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