]> sourceware.org Git - lvm2.git/log
lvm2.git
11 years agolvconvert: also allow --type with --stripes
Peter Rajnoha [Thu, 13 Dec 2012 10:15:37 +0000 (11:15 +0100)]
lvconvert: also allow --type with --stripes

We can also use this for conversion between different mirror segment
types. Each new segment type converter then needs to check itself
whether the --stripes is applicable.

11 years agoUpdate WHATS_NEW.
Petr Rockai [Wed, 12 Dec 2012 14:17:08 +0000 (15:17 +0100)]
Update WHATS_NEW.

11 years agotoollib: Avoid a global lock in process_each_pv if lvmetad is used.
Petr Rockai [Wed, 12 Dec 2012 13:39:52 +0000 (14:39 +0100)]
toollib: Avoid a global lock in process_each_pv if lvmetad is used.

The motivation to grab the global lock is to avoid a scan and metadata parsing
for each PV, but the cost of obtaining metadata is _mostly_ mitigated by having
lvmetad around. Not taking the global lock improves throughput when multiple pvs
or related commands are running in parallel, like in RHEV.

11 years agolvmetad: fix compiler warning and add WHATS_NEW line for previous commit
Peter Rajnoha [Wed, 12 Dec 2012 12:27:25 +0000 (13:27 +0100)]
lvmetad: fix compiler warning and add WHATS_NEW line for previous commit

11 years agolvmetad: Fix autoactivation for MDA-less PVs.
Petr Rockai [Wed, 12 Dec 2012 11:51:28 +0000 (12:51 +0100)]
lvmetad: Fix autoactivation for MDA-less PVs.

Calling pvscan --cache with -aay on a PV without an MDA would spuriously fail
with an internal error, because of an incorrect assumption that a parsed VG
structure was always available. This is not true and the autoactivation handler
needs to call vg_read to obtain metadata in cases where the PV had no MDAs to
parse. Therefore, we pass vgid into the handler instead of the (possibly NULL)
VG coming from the PV's MDA.

11 years agolvconvert: allow lvconvert --stripes/stripesize only with -mirrors/--repair/--thinpool
Peter Rajnoha [Tue, 11 Dec 2012 14:50:25 +0000 (15:50 +0100)]
lvconvert: allow lvconvert --stripes/stripesize only with -mirrors/--repair/--thinpool

Also, update lvconvert man page to reflect this and make clear that
the --stripes/stripesize is applied to newly allocated space only.

11 years agotest: update thin discards testing
Zdenek Kabelac [Mon, 10 Dec 2012 09:51:25 +0000 (10:51 +0100)]
test: update thin discards testing

Reflect fixed disards behavior.

11 years agolvmetad: use dm_config_destroy to free pvmeta
Marian Csontos [Mon, 10 Dec 2012 13:24:55 +0000 (14:24 +0100)]
lvmetad: use dm_config_destroy to free pvmeta

Release pvmeta handler with proper dm_config_destroy() function.
TODO: Fix primary fault for this internal error.

Signed-off-by: mcsontos@redhat.com
11 years agothin: fix test for dicards ignore settings
Zdenek Kabelac [Mon, 10 Dec 2012 09:22:48 +0000 (10:22 +0100)]
thin: fix test for dicards ignore settings

Arghh, this was bad last-minute shortening of if() expression
in the commit 1ef98310187a7.

dm_tree_node_set_thin_pool_discard() must not run in the same
expression as check for non-power-2 discard, otherwise
there are 2 calls for dm_tree_node_set_thin_pool_discard
and whole setting of discards is missinterpretted.

In-relase fix it by using proper parentheses {}.

11 years agothin: remove detection for thin discard support
Zdenek Kabelac [Mon, 10 Dec 2012 09:22:16 +0000 (10:22 +0100)]
thin: remove detection for thin discard support

Remove no longer needed warning for unsuppoted discards
for non-power-2 lvcreate commands.

(Missed from the patch for the same update in lvchange made
by commit dde5a6c52b315d7b)

11 years agomirrors: fix leak in device_is_usable mirror check
Zdenek Kabelac [Thu, 6 Dec 2012 22:37:21 +0000 (23:37 +0100)]
mirrors: fix leak in device_is_usable mirror check

Function _ignore_blocked_mirror_devices was not release
allocated strings images_health and log_health.

In error paths it was also not releasing dm_task structure.

Swaped return code of _ignore_blocked_mirror_devices and
use 1 as success.

In _parse_mirror_status use log_error if memory allocation
fails and few more errors so they are no going unnoticed
as debug messages.

On error path always clear return values and free strings.

For dev_create_file  use cache mem pool to avoid memleak.

11 years agolvconvert: do not ignore -f in lvconvert --repair -y -f
Peter Rajnoha [Tue, 11 Dec 2012 08:52:54 +0000 (09:52 +0100)]
lvconvert: do not ignore -f in lvconvert --repair -y -f

11 years agoFix Py_BuildValue for i386
James Antill [Thu, 6 Dec 2012 00:31:30 +0000 (16:31 -0800)]
Fix Py_BuildValue for i386

see https://bugzilla.redhat.com/show_bug.cgi?id=881989

Signed-off-by: James Antill <james.antill@redhat.com>
Signed-off-by: Andy Grover <agrover@redhat.com>
11 years agopvmove/RAID: Disallow pvmove on RAID LVs until properly handled
Jonathan Brassow [Tue, 4 Dec 2012 23:47:47 +0000 (17:47 -0600)]
pvmove/RAID:  Disallow pvmove on RAID LVs until properly handled

Attempting pvmove on RAID LVs replaces the kernel RAID target with
a temporary pvmove target, ultimately destroying the RAID LV.  pvmove
must be prevented on RAID LVs for now.

Use 'lvconvert --replace old_pv vg/lv new_pv' if you want to move
an image of the RAID LV.

11 years agoactivation: don't miss the log on empty {auto_activation|read_only|}_volume_list
Peter Rajnoha [Tue, 4 Dec 2012 13:10:03 +0000 (14:10 +0100)]
activation: don't miss the log on empty {auto_activation|read_only|}_volume_list

Addendum to previous commit...

11 years agoAllow empty activation/{auto_activation|read_only|}_volume_list config option.
Peter Rajnoha [Tue, 4 Dec 2012 09:33:54 +0000 (10:33 +0100)]
Allow empty activation/{auto_activation|read_only|}_volume_list config option.

In case we don't want to activate, autoactivate or have the
VG/LV read-only. Primarily targeted for the auto_activation_volume_list,
but it makes no harm for other settings (the part of the code
that reads these three settings is shared, but there's no
reason to separate it only for this change).

11 years agothin: update thin feature detection
Zdenek Kabelac [Mon, 3 Dec 2012 12:03:41 +0000 (13:03 +0100)]
thin: update thin feature detection

Safe 1 static var and keep whole detection within one function.

11 years agothin: reworked thin feature detection
Zdenek Kabelac [Mon, 3 Dec 2012 10:52:04 +0000 (11:52 +0100)]
thin: reworked thin feature detection

Rework thin feature detection to support runtime
section to allow to disable them selectively.

New lvm.conf option is born: global/thin_disabled_features

11 years agothin: lvconvert supports swapping metadata device
Zdenek Kabelac [Sun, 2 Dec 2012 15:40:07 +0000 (16:40 +0100)]
thin: lvconvert supports swapping metadata device

Support swapping of metadata device if the thin pool already
exists. This way it's easy to i.e. resize metadata or their
repair operation.

User may create some empty LV, replace existing metadata
or dump and restore them into bigger LV.

11 years agolibdm: deactivate failed node in preload
Zdenek Kabelac [Sun, 2 Dec 2012 15:32:42 +0000 (16:32 +0100)]
libdm: deactivate failed node in preload

If the resume of preloaded node fails, do not leave such
node in the table - since it may not be easy to detach such
node later when the node is i.e. internal.

i.e. failing activation of the thin pool with mismatching
chunk size may leave -tpool device in the table, which
could have been then removed only by dmsetup command.

11 years agothin: deactivate subvolumes
Zdenek Kabelac [Sun, 2 Dec 2012 15:31:27 +0000 (16:31 +0100)]
thin: deactivate subvolumes

Do not leave active thin data and metadata volumes
if activation of thin pool fails.

11 years agothin: lvchange may change discards freely
Zdenek Kabelac [Sun, 2 Dec 2012 15:30:45 +0000 (16:30 +0100)]
thin: lvchange may change discards freely

11 years agothin: shuffle code
Zdenek Kabelac [Sun, 2 Dec 2012 15:27:39 +0000 (16:27 +0100)]
thin: shuffle code

Reorder code lines for next patch.

11 years agothin: lvconvert update messages
Zdenek Kabelac [Sun, 2 Dec 2012 15:23:44 +0000 (16:23 +0100)]
thin: lvconvert update messages

11 years agothin: add detach_pool_metadata_lv
Zdenek Kabelac [Sun, 2 Dec 2012 00:28:51 +0000 (01:28 +0100)]
thin: add detach_pool_metadata_lv

Add internal function detach_pool_metadata_lv().

11 years agotests: add error_dev aux
Zdenek Kabelac [Sat, 1 Dec 2012 16:09:18 +0000 (17:09 +0100)]
tests: add error_dev aux

Aux function to replace PV with specifically damaged device.
Usage:

   aux error_dev "$dev1" 8:32 96:8

Replaces from 8 sector 32 error 512b sectors
and from 96 sector next 8 sectors will fail on rw.
Rest of device is preserved.

For testing:
dd if="$dev1" of=x bs=512 count=104 conv=sync,noerror iflag=direct

11 years agotests: resume devices on background
Zdenek Kabelac [Thu, 29 Nov 2012 16:39:36 +0000 (17:39 +0100)]
tests: resume devices on background

Since some devices may need correct order of their resuming,
resume then all on background and wait for finish.

11 years agolvm2api: fix size reporting
Zdenek Kabelac [Thu, 29 Nov 2012 09:29:03 +0000 (10:29 +0100)]
lvm2api: fix size reporting

API is reporting all sizes as 64bit integers in bytes.
Fix at those places, where sectors were returned
to remain consistent.

11 years agoman page (lvcreate): Better explain stripes option for RAID 4/5/6.
Jonathan Brassow [Fri, 30 Nov 2012 22:47:02 +0000 (16:47 -0600)]
man page (lvcreate):  Better explain stripes option for RAID 4/5/6.

Do a better job explaining the '--stripes/-i' option to lvcreate
when it comes to RAID 4/5/6.  The extra devices needed for parity
are implicitly added to the argument given.  So a 5-device RAID6
logical volume is created with '-i 3' - indicating 3 stripes plus
the implicit 2 devices needed for RAID6.

11 years agoudev: add a warning message if DM_DISABLE_UDEV set and udev running
Peter Rajnoha [Thu, 29 Nov 2012 14:50:52 +0000 (15:50 +0100)]
udev: add a warning message if DM_DISABLE_UDEV set and udev running

$ export DM_DISABLE_UDEV=1

$ dmsetup create test --table "0 1 zero"
Udev is running and DM_DISABLE_UDEV environment variable is set. Bypassing udev, device-mapper library will manage device nodes in device directory.

$ lvchange -ay vg/lvol0
  Udev is running and DM_DISABLE_UDEV environment variable is set. Bypassing udev, LVM will manage logical volume symlinks in device directory.
  Udev is running and DM_DISABLE_UDEV environment variable is set. Bypassing udev, LVM will obtain device list by scanning device directory.
  Udev is running and DM_DISABLE_UDEV environment variable is set. Bypassing udev, device-mapper library will manage device nodes in device directory.

11 years agoudev: _udev_disabled var visible also for !UDEV_SYNC_SUPPORT
Peter Rajnoha [Thu, 29 Nov 2012 13:40:12 +0000 (14:40 +0100)]
udev: _udev_disabled var visible also for !UDEV_SYNC_SUPPORT

11 years agoudev: recognize DM_DISABLE_UDEV environment variable
Peter Rajnoha [Thu, 29 Nov 2012 13:03:48 +0000 (14:03 +0100)]
udev: recognize DM_DISABLE_UDEV environment variable

Setting this environment variable will cause a full fallback
to old direct node and symlink management in libdevmapper and lvm2.

It means:

 - disabling udev synchronization
   (--noudevsync in dmsetup and --noudevsync + activation/udev_sync=0
    lvm2 config)
 - disabling dm and any subsystem related udev rules
   (--noudevrules in dmsetup and activation/udev_rules=0 lvm2 config)
 - management of nodes/symlinks under /dev directly by libdevmapper/lvm2
   (--verifyudev in dmsetup and activation/verify_udev_operations=1
    lvm2 config)
 - not obtaining any device list from udev database
   (devices/obtain_device_list_from_udev=0 lvm2 config)

Note: we could set all of these before - there's no functional change!
However the DM_DISABLE_UDEV environment variable is a nice shortcut
to make it easier for libdevmapper users so that one can switch off all
of the udev management off at one go directly on the command line,
without a need to modify any source or add any extra switches.

11 years agoudev: do not verify udev operations for --noudevsync
Peter Rajnoha [Thu, 29 Nov 2012 12:59:12 +0000 (13:59 +0100)]
udev: do not verify udev operations for --noudevsync

If udev synchronization is disabled by means of --noudevsync
option, we should disable just the synchronization and nothing else.
The udev fallback (verifying udev operations and fixing the
nodes/symlinks if found incorrect) is orthogonal and controlled
by a separate activation/verify_udev_operations configuration option.

11 years agotests: update thin testing
Zdenek Kabelac [Tue, 27 Nov 2012 00:01:38 +0000 (01:01 +0100)]
tests: update thin testing

11 years agothin: fix property discard for lvm2api
Zdenek Kabelac [Tue, 27 Nov 2012 10:02:49 +0000 (11:02 +0100)]
thin: fix property discard for lvm2api

Discards property is string and may have these values:
  ignore, nopassdown, passdown

11 years agothin: allow restore with --force
Zdenek Kabelac [Mon, 26 Nov 2012 22:45:35 +0000 (23:45 +0100)]
thin: allow restore with --force

Allow restoring metadata with thin pool volumes.
No validation is done for this case within vgcfgrestore tool -
thus incorrect metadata may lead to destruction of pool content.

11 years agothin: fix attrs for unloaded driver
Zdenek Kabelac [Mon, 26 Nov 2012 10:05:30 +0000 (11:05 +0100)]
thin: fix attrs for unloaded driver

If the driver is not loaded, set all 'features' ON
instead of all of them being OFF.

11 years agofilters: Add STEC skd and Violin vtms devices
Alasdair G Kergon [Mon, 26 Nov 2012 14:55:17 +0000 (14:55 +0000)]
filters: Add STEC skd and Violin vtms devices

11 years agothin: support configurable thin pool defaults
Zdenek Kabelac [Mon, 26 Nov 2012 10:20:13 +0000 (11:20 +0100)]
thin: support configurable thin pool defaults

Configurable settings for thin pool create
if they are not specified on command line.

New supported lvm.conf options are:
  allocation/thin_pool_chunk_size
  allocation/thin_pool_discards
  allocation/thin_pool_zero

11 years agothin: add more unsupporte options for merge
Zdenek Kabelac [Mon, 26 Nov 2012 10:14:36 +0000 (11:14 +0100)]
thin: add more unsupporte options for merge

Hmm, we need some smarter way to detect unsupported command
line options for various commands.

11 years agothin: detect discards for non-power-2
Zdenek Kabelac [Mon, 26 Nov 2012 10:04:00 +0000 (11:04 +0100)]
thin: detect discards for non-power-2

Check if target supports discards for chunk sizes,
that are not power of 2 (just multiple of 64K),
and enable it in case it's supported by thin kernel target.

11 years agolvm2api: fix typo
Zdenek Kabelac [Wed, 21 Nov 2012 13:29:52 +0000 (14:29 +0100)]
lvm2api: fix typo

oops, typo didn't cause compile error

11 years agoAutomatically restore MISSING PVs with no MDAs.
Petr Rockai [Sun, 25 Nov 2012 19:41:56 +0000 (20:41 +0100)]
Automatically restore MISSING PVs with no MDAs.

11 years agoRAID: If no stripes argument is given for RAID10 create, default to 2
Jonathan Brassow [Thu, 22 Nov 2012 00:46:52 +0000 (18:46 -0600)]
RAID:  If no stripes argument is given for RAID10 create, default to 2

Similar to the way the 'mirror', 'raid1' and 'raid10' segment types set
the number of mirrors to 2 ('-m 1') if the argument is not specified,
here we set the number of stripes to 2 if not given on the command line
when creating a RAID10 LV.

11 years agoRAID: Do not allow --splitmirrors on RAID10 logical volumes.
Jonathan Brassow [Thu, 22 Nov 2012 00:39:26 +0000 (18:39 -0600)]
RAID:  Do not allow --splitmirrors on RAID10 logical volumes.

RAID10 does not have the ability to split off images for independent
use.  So, 'lvconvert --splitmirrors' will not work and must be
disallowed.

11 years agolv_manip: fix regresion from bf2741376d4
Zdenek Kabelac [Wed, 21 Nov 2012 08:46:18 +0000 (09:46 +0100)]
lv_manip: fix regresion from bf2741376d4

Commit bf2741376d47411994d4065863acab8e405ff5c7 started to use
lv_is_active() instead of call for lv_info & info.exists so
we cover also cluster activated devices.
For snapshost the conversion was not correct and introduced
regression by blocking creation of snapshot of inactive LV.

Fix it by assigning lv_is_active() directly.
Note: we still have minor issue to fix - to make
lv_is_???? function able to return error states since
lv_info() may fail.

11 years agomm: skip mlocking [vectors]
Zdenek Kabelac [Tue, 20 Nov 2012 08:58:53 +0000 (09:58 +0100)]
mm: skip mlocking [vectors]

Somehow forgotten:
https://www.redhat.com/archives/linux-lvm/2012-June/msg00019.html
Need for arm architecture support.

11 years agodocs: host tags has a default volume_list
Alasdair G Kergon [Mon, 19 Nov 2012 22:29:23 +0000 (22:29 +0000)]
docs: host tags has a default volume_list

Document that lvm.conf activation/volume_list defaults to @* when
there's a host tag.

11 years agothin: update recent patchset
Zdenek Kabelac [Mon, 19 Nov 2012 15:23:18 +0000 (16:23 +0100)]
thin: update recent patchset

Parse pool params only for creation of thin pools.

11 years agoDocument use_lvmetad and global_filter in lvm.conf.5.
Petr Rockai [Mon, 19 Nov 2012 15:19:58 +0000 (16:19 +0100)]
Document use_lvmetad and global_filter in lvm.conf.5.

11 years agotest: testing lvconvert
Zdenek Kabelac [Mon, 19 Nov 2012 11:31:11 +0000 (12:31 +0100)]
test: testing lvconvert

11 years agothin: man page updates
Zdenek Kabelac [Tue, 30 Oct 2012 17:11:59 +0000 (17:11 +0000)]
thin: man page updates

Cover latest extensions of lvconvert functionality.
Update also lvcreate page.

11 years agothin: lvcreate use common functions
Zdenek Kabelac [Mon, 19 Nov 2012 11:47:34 +0000 (12:47 +0100)]
thin: lvcreate use common functions

Use common functions from toollib and eliminate code from here.

11 years agothin: lvconvert update
Zdenek Kabelac [Mon, 19 Nov 2012 12:37:57 +0000 (13:37 +0100)]
thin: lvconvert update

Use common function from toollib and support allocation
of metadata LV with give thin pool data LV.

11 years agothin: add alloc_pool_metadata
Zdenek Kabelac [Mon, 19 Nov 2012 12:37:36 +0000 (13:37 +0100)]
thin: add alloc_pool_metadata

Since our api call is not yet powerfull enough,
use this wrapper to preset options.

11 years agothin: add common pool functions
Zdenek Kabelac [Thu, 15 Nov 2012 13:48:32 +0000 (14:48 +0100)]
thin: add common pool functions

Move common functions for lvcreate and lvconvert.

get_pool_params() - read thin pool args.
update_pool_params() - updates/validates some thin args.

It is getting complicated and even few more things will be
implemented, so to avoid reimplementing things differently
in lvcreate and lvconvert  code has been splitted
into 2 common functions that allow some future extension.

11 years agoliblvm: internal API change
Zdenek Kabelac [Tue, 13 Nov 2012 09:49:32 +0000 (10:49 +0100)]
liblvm: internal API change

Return LV/NULL instead of 1/0 which saves lookup for created LV.

11 years agolvconvert: store target attributes
Zdenek Kabelac [Thu, 15 Nov 2012 09:32:13 +0000 (10:32 +0100)]
lvconvert: store target attributes

Target tells us its version, and we may allow different set of options
to be supported with different version of driver.

Idea is to provide individual feature flags and later be
able to query for them.

11 years agocleanup: move setting of parameter zero
Zdenek Kabelac [Thu, 15 Nov 2012 13:47:37 +0000 (14:47 +0100)]
cleanup: move setting of parameter zero

Since we may need to use different default value,
move read of zero_ARG prior processing of parameters.

11 years agomirror: Mirrored log should be fixed before mirror when double fault occurs
Jonathan Brassow [Wed, 14 Nov 2012 20:58:47 +0000 (14:58 -0600)]
mirror:  Mirrored log should be fixed before mirror when double fault occurs

This patch is intended to fix bug 825323 - FS turns read-only during a double
fault of a mirror leg and mirrored log's leg at the same time.  It only
affects a 2-way mirror with a mirrored log.  3+-way mirrors and mirrors
without a mirrored log are not affected.

The problem resulted from the fact that the top level mirror was not
using 'noflush' when suspending before its "down-convert".  When a
mirror image fails, the bios are queue until a suspend is recieved.  If
it is a 'noflush' suspend, the bios can be safely requeued in the DM
core.  If 'noflush' is not used, the bios must be pushed through the
target and if a device is failed for a mirror, that means issuing an
error.  When an error is received by a file system, it results in it
turning read-only (depending on the FS).

Part of the problem was is due to the nature of the stacking involved in
using a mirror as a mirror's log.  When an image in each fail, the top
level mirror stalls because it is waiting for a log flush.  The other
stalls waiting for corrective action.  When the repair command is issued,
the entire stacked arrangement is collapsed to a linear LV.  The log
flush then fails (somewhat uncleanly) and the top-level mirror is suspended
without 'noflush' because it is a linear device.

This patch allows the log to be repaired first, which in turn allows the
top-level mirror's log flush to complete cleanly.  The top-level mirror
is then secondarily reduced to a linear device - at which time this mirror
is suspended properly with 'noflush'.

11 years agopython-lvm: Initial check-in of python-lvm unit test case.
Tony Asleson [Fri, 26 Oct 2012 20:35:17 +0000 (15:35 -0500)]
python-lvm: Initial check-in of python-lvm unit test case.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
11 years agotest: set LD_LIBRARY_PATH to all dirs with *.so
Tony Asleson [Fri, 26 Oct 2012 20:30:21 +0000 (15:30 -0500)]
test: set LD_LIBRARY_PATH to all dirs with *.so

Instead of manually editing entries, add all the
directories which contain shared objects.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
11 years agopvscan: exit --cache immediately if locking_type=3 || use_lvmetad=0
Peter Rajnoha [Fri, 9 Nov 2012 14:56:57 +0000 (15:56 +0100)]
pvscan: exit --cache immediately if locking_type=3 || use_lvmetad=0

11 years agosystemd: remove quotes in lvm2-monitor.service ExecStop
Peter Rajnoha [Fri, 2 Nov 2012 19:32:28 +0000 (20:32 +0100)]
systemd: remove quotes in lvm2-monitor.service ExecStop

11 years agosystemd: do not remove lvm2-activation.service
Peter Rajnoha [Thu, 1 Nov 2012 12:33:49 +0000 (13:33 +0100)]
systemd: do not remove lvm2-activation.service

Fix previous commit 360c569ce8f0bfe936d59ca91de2716958550524.
Remove only fedora-storage-init/fedora-storage-init-late.service, but
not lvm2-activation.service.
fedora-storage-init.service fedora-storage-init-late.service

11 years agosystemd: various updates and fixes
Peter Rajnoha [Tue, 30 Oct 2012 19:36:49 +0000 (20:36 +0100)]
systemd: various updates and fixes

Don't use lvmetad in lvm2-monitor.service ExecStop to avoid a systemd issue.
 - a systemd design issue while processing dependencies
   with socket-based activation that ends up with a hang
 - https://bugzilla.redhat.com/show_bug.cgi?id=843587
   (also tracker bug https://bugzilla.redhat.com/show_bug.cgi?id=871527)
 - not using lvmetad in this case is just a workaround, once the bug
   above is resolved, we should enable the lvmetad in that specific case

Remove dependency on fedora-storage-init.service in lvm2 systemd units.
 - fedora-storage-init.service and fedora-storage-init-late.service is
   going to be separated into respective units that belong to each block
   device subsystem:
     - mpath + mdraid activated via udev solely
     - dmraid with its own dmraid-activation.service unit
     - lvm2 with the lvm2-activation-generator to generate the
       activation units runtime if lvmetad disabled
       (global/use_lvmetad=0 set in lvm.conf) and activation done
       via udev+lvmetad if lvmetad enabled (global/use_lvmetad=1 set
       in lvm.conf)

Depend on lvm2-lvmetad.socket in lvm2-monitor.service systemd unit.
 - as lvm2-monitor uses lvmetad if lvmetad is enabled

11 years agotest: Check that overriding use_lvmetad with --config works.
Petr Rockai [Tue, 30 Oct 2012 08:16:15 +0000 (09:16 +0100)]
test: Check that overriding use_lvmetad with --config works.

11 years agolvmetad: Init lazily, to avoid socket access on config overrides.
Petr Rockai [Mon, 29 Oct 2012 20:39:46 +0000 (21:39 +0100)]
lvmetad: Init lazily, to avoid socket access on config overrides.

11 years agolvmetad: warn only if use_lvmetad=1 and locking_type=3
Peter Rajnoha [Mon, 29 Oct 2012 15:20:35 +0000 (16:20 +0100)]
lvmetad: warn only if use_lvmetad=1 and locking_type=3

11 years agopython-lvm: Memory leaks & seg. fault fixes
Tony Asleson [Thu, 25 Oct 2012 22:31:11 +0000 (17:31 -0500)]
python-lvm: Memory leaks & seg. fault fixes

Issues found (thus far) in unit test developemnt for python bindings.

Added Py_DECREF(ptr) in liblvm_lvm_vg_open & liblvm_lvm_vg_create
in error paths so that we correctly clean up memory.

Added a call to lvm_vg_close when we remove a vg.  The code was
clearing out the vg pointer which prevented us from actually
calling lvm_vg_close in the close path.

liblvm_lvm_vg_create_lv_linear was not initializing
lvobj->parent_vgobj and if lvm_vg_create_lv_linear failed
we went through liblvm_lv_dealloc on clean up and tried to
Py_DECREF an invalid pointer.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
11 years agoWHATS_NEW: latest changes under libdm 1.02.78
Peter Rajnoha [Thu, 25 Oct 2012 14:29:35 +0000 (16:29 +0200)]
WHATS_NEW: latest changes under libdm 1.02.78

11 years agolvmetad: whats_new + more explanation for previous commit
Peter Rajnoha [Thu, 25 Oct 2012 12:47:45 +0000 (14:47 +0200)]
lvmetad: whats_new + more explanation for previous commit

11 years agolvmetad: Disable and warn when locking_type is 3.
Petr Rockai [Thu, 25 Oct 2012 12:30:03 +0000 (14:30 +0200)]
lvmetad: Disable and warn when locking_type is 3.

11 years agomirror: Avoid reading mirrors with failed devices in mirrored log
Jonathan Brassow [Thu, 25 Oct 2012 05:42:45 +0000 (00:42 -0500)]
mirror:  Avoid reading mirrors with failed devices in mirrored log

Commit 9fd7ac7d035f0b2f8dcc3cb19935eb181816bd76 did not handle mirrors
that contained mirrored logs.  This is because the status line of the
mirror does not give an indication of the health of the mirrored log,
as you can see here:
        [root@bp-01 lvm2]# dmsetup status vg-lv vg-lv_mlog
        vg-lv: 0 409600 mirror 2 253:6 253:7 400/400 1 AA 3 disk 253:5 A
        vg-lv_mlog: 0 8192 mirror 2 253:3 253:4 7/8 1 AD 1 core
Thus, the possibility for LVM commands to hang still persists when mirror
have mirrored logs.  I discovered this while performing some testing that
does polling with 'pvs' while doing I/O and killing devices.  The 'pvs'
managed to get between the mirrored log device failure and the attempt
by dmeventd to repair it.  The result was a very nasty block in LVM
commands that is very difficult to remove - even for someone who knows
what is going on.  Thus, it is absolutely essential that the log of a
mirror be recursively checked for mirror devices which may be failed
as well.

Despite what the code comment says in the aforementioned commit...
+ * _mirrored_transient_status().  FIXME: It is unable to handle mirrors
+ * with mirrored logs because it does not have a way to get the status of
+ * the mirror that forms the log, which could be blocked.
... it is possible to get the status of the log because the log device
major/minor is given to us by the status output of the top-level mirror.
We can use that to query the log device for any DM status and see if it
is a mirror that needs to be bypassed.  This patch does just that and is
now able to avoid reading from mirrors that have failed devices in a
mirrored log.

11 years agomirror: Avoid reading from mirrors that have failed devices
Jonathan Brassow [Wed, 24 Oct 2012 04:10:33 +0000 (23:10 -0500)]
mirror:  Avoid reading from mirrors that have failed devices

Addresses: rhbz855398 (Allow VGs to be built on cluster mirrors),
           and other issues.

The LVM code attempts to avoid reading labels from devices that are
suspended to try to avoid situations that may cause the commands to
block indefinitely.  When scanning devices, 'ignore_suspended_devices'
can be set so the code (lib/activate/dev_manager.c:device_is_usable())
checks any DM devices it finds and avoids them if they are suspended.

The mirror target has an additional mechanism that can cause I/O to
be blocked.  If a device in a mirror fails, all I/O will be blocked
by the kernel until a new table (a linear target or a mirror with
replacement devices) is loaded.  The mirror indicates that this condition
has happened by marking a 'D' for the faulty device in its status
output.  This condition must also be checked by 'device_is_usable()' to
avoid the possibility of blocking LVM commands indefinitely due to an
attempt to read the blocked mirror for labels.

Until now, mirrors were avoided if the 'ignore_suspended_devices'
condition was set.  This check seemed to suggest, "if we are concerned
about suspended devices, then let's ignore mirrors altogether just
in case".  This is insufficient and doesn't solve any problems.  All
devices that are suspended are already avoided if
'ignore_suspended_devices' is set; and if a mirror is blocking because
of an error condition, it will block the LVM command regardless of the
setting of that variable.

Rather than avoiding mirrors whenever 'ignore_suspended_devices' is
set, this patch causes mirrors to be avoided whenever they are blocking
due to an error.  (As mentioned above, the case where a DM device is
suspended is already covered.)  This solves a number of issues that weren't
handled before.  For example, pvcreate (or any command that does a
pv_read or vg_read, which eventually call device_is_usable()) will be
protected from blocked mirrors regardless of how
'ignore_suspended_devices' is set.  Additionally, a mirror that is
neither suspended nor blocking is /allowed/ to be read regardless
of how 'ignore_suspended_devices' is set.  (The latter point being the
source of the fix for rhbz855398.)

11 years agoWHATS_NEW: Entry for commit e1917809477c4850cc1094121001d61a2b70ef26
Jonathan Brassow [Wed, 24 Oct 2012 02:38:37 +0000 (21:38 -0500)]
WHATS_NEW:  Entry for commit e1917809477c4850cc1094121001d61a2b70ef26

WHATS_NEW commit for 'lvs' output change to add RAID 4/5/6 sync %age
to s/Copy%/Cpy%Sync/ output.

11 years agoRAID: Make RAID 4/5/6 display sync status under heading s/Copy%/Cpy%Sync
Jonathan Brassow [Wed, 24 Oct 2012 02:19:27 +0000 (21:19 -0500)]
RAID:  Make RAID 4/5/6 display sync status under heading s/Copy%/Cpy%Sync

The heading 'Copy%' is specific to PVMOVE volumes, but can be generalized
to apply to LVM mirrors also.  It is a bit awkward to use 'Copy%' for
RAID 4/5/6, however - 'Sync%' would be more appropriate.  This is why
RAID 4/5/6 have not displayed their sync status by any means available to
'lvs' yet.

Example (old):
[root@hayes-02 lvm2]# lvs vg
  LV      VG   Attr      LSize  Pool Origin Data%  Move Log Cpy%Sy Convert
  lv    vg   -wi-a----  1.00g
  raid1 vg   rwi-a-r--  1.00g                             100.00
  raid4 vg   rwi-a-r--  1.01g
  raid5 vg   rwi-a-r--  1.01g
  raid6 vg   rwi-a-r--  1.01g

This patch changes the heading to 'Cpy%Sync' and allows RAID 4/5/6 to print
their sync percent in this field.

Example (new):
[root@hayes-02 lvm2]# lvs vg
  LV    VG   Attr      LSize Pool Origin Data%  Move Log Cpy%Sync Convert
  lv    vg   -wi-a---- 1.00g
  raid1 vg   rwi-a-r-- 1.00g                               100.00
  raid4 vg   rwi-a-r-- 1.01g                               100.00
  raid5 vg   rwi-a-r-- 1.01g                               100.00
  raid6 vg   rwi-a-r-- 1.01g                               100.00

11 years agomirror/raid: Move 'copy_percent' to common code (mirror.c -> lv_manip.c)
Jonathan Brassow [Wed, 24 Oct 2012 01:33:54 +0000 (20:33 -0500)]
mirror/raid:  Move 'copy_percent' to common code (mirror.c -> lv_manip.c)

The 'copy_percent' function takes the 'extents_copied' field from each
segment in an LV to create the numerator for the ratio that is to
become the copy_percent.  (Otherwise known as the 'sync' percent for
non-pvmove uses, like mirror LVs and RAID LVs.)  This function safely
works on RAID - not just mirrors - so it is better to have it in
lv_manip.c rather than mirror.c.

There's a lot of different functions that do a lot of different things
in lv_manip.c, so I placed the function near a function in lv_manip.c
that it was close to in metadata-exported.h.  Different placement in the
file or a different name for the function may be useful.

11 years agopython-lvm: seg. fault in liblvm_lvm_percent_to_float
Tony Asleson [Tue, 23 Oct 2012 19:50:14 +0000 (14:50 -0500)]
python-lvm: seg. fault in liblvm_lvm_percent_to_float

The first parameter needs to be present even if it isn't being
used, otherwise the one any only parameter we get is null
which causes PyArg_ParseTuple to seg. fault.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
11 years agoudev_sync: cookie_set=1 on each dm_task_set_cookie call
Peter Rajnoha [Tue, 23 Oct 2012 09:40:53 +0000 (11:40 +0200)]
udev_sync: cookie_set=1 on each dm_task_set_cookie call

cookie_set variable found in the struct dm_task should be always
set to 1 after dm_task_set_cookie_call, even if udev_sync is disabled
as the cookie itself carries synchronization informations *as well as*
extra flags to control other aspects of udev support.

For example, one could disable the synchronization itself, but still
direct the libdm code to disable library fallback via
DM_UDEV_DISABLE_LIBRARY_FALLBACK flag. These extra flags still need
to be carried out!

A concrete example:
  $ dmsetup create test --table "0 1 zero" --noudevsync

This disables synchronization with udev. As the --verifyudev option is
not used, we don't want to do any corrections. In other words, we
need DM_UDEV_DISABLE_LIBRARY_FALLBACK flag to be used. However,
with --noudevsync this was not the case - the flag was ignored!

This patch fixes the case when noudevsync is used but there are still
some extra flags passed within the cookie flag part. The synchronization
part of the cookie stays zero (which is ok as dm_udev_wait call on such a
cookie is simply a NOOP).

11 years agoversion: update
Marian Csontos [Mon, 22 Oct 2012 12:16:06 +0000 (14:16 +0200)]
version: update

11 years agoclvmd: fix parsing of -d argument
Zdenek Kabelac [Fri, 19 Oct 2012 13:18:19 +0000 (15:18 +0200)]
clvmd: fix parsing of -d argument

clvmd -d option parsing was not working properly.

clvmd -d 2   (with space) has been ignored because of
'::' used in getopt string, and as failsafe it's been used '1'.

Later this debug_arg has been ignored and debug_opt was used
instead which happend to have value '1'.

Submitted-by: Robert Milasan <rmilasan at suse.com>
Reported-by: Robert Milasan <rmilasan at suse.com>
11 years agolvchange: support --yes option for --persistent
Zdenek Kabelac [Fri, 19 Oct 2012 12:16:15 +0000 (14:16 +0200)]
lvchange: support --yes option for --persistent

Support using command: lvchange --yes --persistent
to skip y|n prompt.

11 years agocleanup: fix typo in error message
Zdenek Kabelac [Fri, 19 Oct 2012 11:57:22 +0000 (13:57 +0200)]
cleanup: fix typo in error message

yes -> yet

11 years agopvcreate: fix leak on error path
Zdenek Kabelac [Thu, 18 Oct 2012 12:32:56 +0000 (14:32 +0200)]
pvcreate: fix leak on error path

Missing vg release on error path.
Add tests for few more error cases.

11 years agopython-lvm: Implement proper refcounting for parent objects
Andy Grover [Wed, 17 Oct 2012 19:55:25 +0000 (12:55 -0700)]
python-lvm: Implement proper refcounting for parent objects

Our object nesting:

lib -> VG -> LV -> lvseg
          -> PV -> pvseg

Implement refcounting and checks to ensure parent objects are not
dealloced before their children. Also ensure calls to self or child's
methods are handled cleanly for objects that have been closed or removed.

Ensure all functions that are object methods have a first parameter named
'self', for consistency

Rename local vars that reference a Python object to '*obj', in order to
differentiate from liblvm handles

Fix a misspelled pv method name

Signed-off-by: Andy Grover <agrover@redhat.com>
11 years agoUse lv_is_active instead of lv_info()
Zdenek Kabelac [Tue, 31 Jan 2012 22:42:53 +0000 (23:42 +0100)]
Use lv_is_active instead of lv_info()

Usage of lv_is_active makes it more obvious what is being checked.

11 years agocleanup: move log_error upward in code stack
Zdenek Kabelac [Tue, 16 Oct 2012 08:20:02 +0000 (10:20 +0200)]
cleanup: move log_error upward in code stack

Report log_error earlier.

11 years agocleanup: switch log_error to log_warn
Zdenek Kabelac [Tue, 16 Oct 2012 08:14:41 +0000 (10:14 +0200)]
cleanup: switch log_error to log_warn

Use log_warn to print non-fatal warning messages.

Use of log_error would confuse checker for testing
whether proper error has been reported for some real error.

11 years agocleanup: swap return values
Zdenek Kabelac [Tue, 16 Oct 2012 08:07:27 +0000 (10:07 +0200)]
cleanup: swap return values

Use lvm standard return code for success/fail  1/0.

11 years agopython-lvm: Update example to work with lvm object removal.
Tony Asleson [Mon, 15 Oct 2012 20:54:19 +0000 (13:54 -0700)]
python-lvm: Update example to work with lvm object removal.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
Signed-off-by: Andy Grover <agrover@redhat.com>
11 years agopython-lvm: whitespace and Yoda conditionals
Andy Grover [Mon, 15 Oct 2012 20:34:43 +0000 (13:34 -0700)]
python-lvm: whitespace and Yoda conditionals

Signed-off-by: Andy Grover <agrover@redhat.com>
11 years agopython-lvm: Remove liblvm object
Andy Grover [Mon, 15 Oct 2012 20:26:01 +0000 (13:26 -0700)]
python-lvm: Remove liblvm object

Instead of requiring users to create a liblvm object, and then calling
methods on it, the module acquires a liblvm handle as part of
initialization. This makes it impossible to instantiate a liblvm object
with a different systemdir, but there is an alternate envvar method for
that obscure use case.

Signed-off-by: Andy Grover <agrover@redhat.com>
11 years agoTEST: Re-add testing of lvconvert-raid for kernels < 3.2
Jonathan Brassow [Mon, 15 Oct 2012 20:43:15 +0000 (15:43 -0500)]
TEST:  Re-add testing of lvconvert-raid for kernels < 3.2

I'm not sure what 'BUG's were being encountered when the restriction
to limit lvconvert-raid.sh tests to kernels > 3.2 was added.  I do know
that there were BUG's that could be triggered when testing snapshots and
some of the earliest DM RAID available in the kernel.  I've taken out
the 3.2 kernel restriction and added a dm-raid >= 1.2 restriction instead.
This will allow the test to run on patched production kernels.

11 years agoRAID: Add "raid10" to lvcreate man page.
Jonathan Brassow [Mon, 15 Oct 2012 20:41:14 +0000 (15:41 -0500)]
RAID:  Add "raid10" to lvcreate man page.

In addition to reference to raid10 under the '--type' argument, an
example creating a RAID10 LV has been added.

11 years agoClean-up: Adjust message to be clearer on action taken and why
Jonathan Brassow [Mon, 15 Oct 2012 20:09:05 +0000 (15:09 -0500)]
Clean-up:  Adjust message to be clearer on action taken and why

A message is printed when the region_size of a RAID LV is adjusted
to allow for large (> ~1TB) LVs.  The message wasn't very clear.
Hopefully, this is better.

11 years agorelease: prepare for release v2_02_98
Alasdair G Kergon [Mon, 15 Oct 2012 14:19:32 +0000 (15:19 +0100)]
release: prepare for release

11 years agoscripts: blk-availability - use full name for clarity
Peter Rajnoha [Mon, 15 Oct 2012 14:10:58 +0000 (16:10 +0200)]
scripts: blk-availability - use full name for clarity

"Stopping blk-availability" -> "Stopping block device availability:"

11 years agolibdm: fix comments in libdevmapper.h
Peter Rajnoha [Mon, 15 Oct 2012 13:40:37 +0000 (15:40 +0200)]
libdm: fix comments in libdevmapper.h

11 years agolvmetad: rename DEBUG() to DEBUGLOG()
Alasdair G Kergon [Mon, 15 Oct 2012 13:20:11 +0000 (14:20 +0100)]
lvmetad: rename DEBUG() to DEBUGLOG()

DEBUG is already defined by -DDEBUG

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