]> sourceware.org Git - lvm2.git/log
lvm2.git
11 years agoclvmd: Fix node up/down handing in corosync module
Christine Caulfield [Mon, 23 Sep 2013 12:23:00 +0000 (13:23 +0100)]
clvmd: Fix node up/down handing in corosync module

The corosync cluster interface for clvmd did not correctly
deal with node up/down events so that when a node was removed
from the cluster clvmd would prevent remote operations
from happening, as it thought the node was up but not
running clvmd.

This patch fixes that code by simplifying the case to node
being  up or down - which was the original intention
and is supported by pacemaker and CPG in the higher layers.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
11 years agotests: drop extra loop
Zdenek Kabelac [Thu, 19 Sep 2013 12:04:18 +0000 (14:04 +0200)]
tests: drop extra loop

Loop was added as a result of unworking singlenode locking, since
this should be now fixed - remove this workaround.

11 years agotests: drop pointeless test
Zdenek Kabelac [Thu, 19 Sep 2013 12:03:39 +0000 (14:03 +0200)]
tests: drop pointeless test

Writing directly to thin-pool and reading it is not a good idea.

11 years agotests: fix typo VEROSE->VERBOSE in Makefile.in
Zdenek Kabelac [Thu, 19 Sep 2013 12:03:03 +0000 (14:03 +0200)]
tests: fix typo VEROSE->VERBOSE in Makefile.in

11 years agotests: hide expected error message
Zdenek Kabelac [Wed, 18 Sep 2013 08:48:51 +0000 (10:48 +0200)]
tests: hide expected error message

11 years agoMakefile: add missing deps
Zdenek Kabelac [Thu, 5 Sep 2013 09:32:42 +0000 (11:32 +0200)]
Makefile: add missing deps

Add missing deps for device-mapper build of scripts dir.
Cleanup multiple SUBDIR lines together.

11 years agoactivation: use improved lv_info
Zdenek Kabelac [Thu, 19 Sep 2013 20:18:16 +0000 (22:18 +0200)]
activation: use improved lv_info

Call lv_info() with info == NULL to query for local active presence.

11 years agolvinfo: allow to use lv_info with NULL info
Zdenek Kabelac [Thu, 19 Sep 2013 12:05:55 +0000 (14:05 +0200)]
lvinfo: allow to use lv_info with NULL info

When NULL info struct is passed in - function is usable
as a quick query for  lv_is_active_locally() - with a bonus
we may query for layered device.

So it could be seen as a more efficient lv_is_active_locally().

11 years agoraid: add lv_is_raid()
Zdenek Kabelac [Wed, 18 Sep 2013 15:22:14 +0000 (17:22 +0200)]
raid: add lv_is_raid()

More readable then status bit flag masking...

11 years agodmeventd: simplify fifos init
Zdenek Kabelac [Thu, 5 Sep 2013 11:14:19 +0000 (13:14 +0200)]
dmeventd: simplify fifos init

Simplier code.

11 years agocleanup: drop unused report parameter
Zdenek Kabelac [Mon, 23 Sep 2013 09:01:46 +0000 (11:01 +0200)]
cleanup: drop unused report parameter

Do not pass unused dm_report pointer.

11 years agocleanup: add log_error error path messages
Zdenek Kabelac [Mon, 23 Sep 2013 07:59:37 +0000 (09:59 +0200)]
cleanup: add log_error error path messages

11 years agocleanup: shorter code
Zdenek Kabelac [Mon, 23 Sep 2013 07:44:53 +0000 (09:44 +0200)]
cleanup: shorter code

Put assignment on declaration line.

11 years agocleanup: release all memory in error path
Zdenek Kabelac [Thu, 19 Sep 2013 20:23:43 +0000 (22:23 +0200)]
cleanup: release all memory in error path

Just ensure no memory will stay in pool even in error path.

11 years agocleanup: skip call of detect...
Zdenek Kabelac [Fri, 20 Sep 2013 13:52:25 +0000 (15:52 +0200)]
cleanup: skip call of detect...

SInce we know the pool was locked and we want to reloc pool again,
just use '1' directly.

11 years agocleanup: monitoring more readable
Zdenek Kabelac [Thu, 5 Sep 2013 09:32:42 +0000 (11:32 +0200)]
cleanup: monitoring more readable

Put continue path into one code segment.

11 years agotest: Blacklist fedora-19 kernel for RAID4/5/6 dev replace tests
Jonathan Brassow [Fri, 20 Sep 2013 16:33:29 +0000 (11:33 -0500)]
test: Blacklist fedora-19 kernel for RAID4/5/6 dev replace tests

A know issue with kmem_cach is causing failures while testing
RAID 4/5/6 device replacement.  Blacklist the offending kernel
so that these tests are not performed there.

11 years agorelease 2.02.101 v2_02_101
Alasdair G Kergon [Fri, 20 Sep 2013 12:56:29 +0000 (13:56 +0100)]
release 2.02.101

112 files changed, 4131 insertions(+), 1312 deletions(-)

11 years agoudev: remove unused line in 69-dm-lvm-metad.rules
Peter Rajnoha [Fri, 20 Sep 2013 07:42:27 +0000 (09:42 +0200)]
udev: remove unused line in 69-dm-lvm-metad.rules

The explicit check for *_raid_member is not actually needed as
this gets filtered out by the ENV{ID_FS_TYPE}!="LVM2_member|LVM1_member" rule.

11 years agoRAID: Don't allow syncaction changes on non-RAID LVs
Jonathan Brassow [Fri, 20 Sep 2013 03:33:01 +0000 (22:33 -0500)]
RAID: Don't allow syncaction changes on non-RAID LVs

Don't allow syncaction or other RAID-type messages on non-RAID
logical volumes.

11 years agoclvmd: Avoid a 3-way deadlock in dead-client cleanup.
Petr Rockai [Sun, 8 Sep 2013 22:01:44 +0000 (00:01 +0200)]
clvmd: Avoid a 3-way deadlock in dead-client cleanup.

11 years agovgconvert: Do not call lvmetad_vg_remove (path shared with vgcfgbackup).
Petr Rockai [Wed, 18 Sep 2013 10:53:11 +0000 (12:53 +0200)]
vgconvert: Do not call lvmetad_vg_remove (path shared with vgcfgbackup).

11 years agovgcfgrestore: Remove VG rom lvmetad later, to better deal with errors.
Petr Rockai [Wed, 18 Sep 2013 09:22:49 +0000 (11:22 +0200)]
vgcfgrestore: Remove VG rom lvmetad later, to better deal with errors.

11 years agovgcfgrestore: Remove the VG from lvmetad before overwriting it.
Petr Rockai [Wed, 18 Sep 2013 08:34:38 +0000 (10:34 +0200)]
vgcfgrestore: Remove the VG from lvmetad before overwriting it.

11 years agoman: lvs man page was not accurate on the volume health bit of lv_attr
Jonathan Brassow [Wed, 18 Sep 2013 04:03:57 +0000 (23:03 -0500)]
man: lvs man page was not accurate on the volume health bit of lv_attr

The 'm'ismatches flag only shows after a "check" scrubbing operation -
not after a "check" or "repair" as indicated by the man page.

11 years agodmsetup: Detect invalid sector supplied to message.
Alasdair G Kergon [Wed, 18 Sep 2013 00:24:19 +0000 (01:24 +0100)]
dmsetup: Detect invalid sector supplied to message.

atoll doesn't check for errors, so invalid sector numbers were silently
accepted in the "dmsetup message" command.

(Mikulas)

11 years agotools: Avoid overflow in _get_int_arg.
Alasdair G Kergon [Wed, 18 Sep 2013 00:16:48 +0000 (01:16 +0100)]
tools: Avoid overflow in _get_int_arg.

Use strtoull instead of strtol so that argument size is not cut
to 31 bytes on machines with 32-bit long.

(Mikulas)

11 years agolibdm: avoid leak if dm_task_set_* fn called again
Alasdair G Kergon [Wed, 18 Sep 2013 00:13:06 +0000 (01:13 +0100)]
libdm: avoid leak if dm_task_set_* fn called again

(Mikulas)

11 years agoreporting: Add devtypes command.
Alasdair G Kergon [Wed, 18 Sep 2013 00:09:15 +0000 (01:09 +0100)]
reporting: Add devtypes command.

Add internal devtypes reporting command to display built-in recognised
block device types.  (The output does not include any additional
types added by a configuration file.)

> lvm devtypes -o help
  Device Types Fields
  -------------------
    devtype_all            - All fields in this section.
    devtype_name           - Name of Device Type exactly as it appears in /proc/devices.
    devtype_max_partitions - Maximum number of partitions. (How many device minor numbers get reserved for each device.)
    devtype_description    - Description of Device Type.

> lvm devtypes
  DevType       MaxParts Description
  aoe                 16 ATA over Ethernet
  ataraid             16 ATA Raid
  bcache               1 bcache block device cache
  blkext               1 Extended device partitions
...

11 years agoWHATS_NEW: Better description for commit 82228ac
Jonathan Brassow [Mon, 16 Sep 2013 20:37:48 +0000 (15:37 -0500)]
WHATS_NEW: Better description for commit 82228ac

More correct description of changes made to disallow thin+mirror.

11 years agodebug: Use // for commented out debug #defines
Alasdair G Kergon [Mon, 16 Sep 2013 19:20:26 +0000 (20:20 +0100)]
debug: Use // for commented out debug #defines

The traditional style used for optional editable definitions
/* #define X /* */
produces a bogus warning from gcc -Wall.

Rather than suppressing this with -Wno-comment, switch over to
the // comment style.

11 years agoMakefiles: Fix CC variable override.
Alasdair G Kergon [Mon, 16 Sep 2013 18:57:14 +0000 (19:57 +0100)]
Makefiles: Fix CC variable override.

The CC override in commit f42b2d4bbf16345e5b5457f4298e751d5c134776
caused the built-in value to be used instead of the configured value
when it wasn't being overridden.

The behaviour is explained here:
http://stackoverflow.com/questions/18007326/how-to-change-default-values-of-variables-like-cc-in-makefile

11 years agofilters: Add bcache.
Alasdair G Kergon [Mon, 16 Sep 2013 15:56:55 +0000 (16:56 +0100)]
filters: Add bcache.

N.B. Using bcache devices as PVs is still experimental.
Problems should be reported to the appropriate mailing lists.

11 years agodoc: add a note about device filtering while lvmetad is used
Peter Rajnoha [Mon, 16 Sep 2013 14:28:28 +0000 (16:28 +0200)]
doc: add a note about device filtering while lvmetad is used

11 years agotests: no activate LV
Zdenek Kabelac [Mon, 16 Sep 2013 13:38:42 +0000 (15:38 +0200)]
tests: no activate LV

Since our current vgcfgbackup/restore doesn't deal
with difference of active volumes between current and
restored set of volumes -  run test with inactive LVs.

11 years agotests: update vgcfgrestore test
Zdenek Kabelac [Mon, 16 Sep 2013 11:46:17 +0000 (13:46 +0200)]
tests: update vgcfgrestore test

Test vgcfgrestore when seqno of restored mda is smaller then current
metadata on device.

11 years agosystemd: run lvm2-activation-net.service after lvm2-activation.service
Peter Rajnoha [Mon, 16 Sep 2013 09:47:09 +0000 (11:47 +0200)]
systemd: run lvm2-activation-net.service after lvm2-activation.service

The lvm2-activation-net.service was ordered only with respect to iscsi
and fcoe service before. In addition to that, we also need ordering
with respect to lvm2-activation.service to prevent parallel vgchange -aay
runs which may cause some problems during activation.
See also https://bugs.gentoo.org/show_bug.cgi?id=480066.

With this patch, the ordering is firmly set to:
lvm2-activation-early.service -> lvm2-activation.service -> lvm2-activation-net.service

Thanks to Alexander Tsoy for the original patch (modified a bit here):
https://www.redhat.com/archives/lvm-devel/2013-September/msg00049.html

11 years agotests: enhance pvmove testing
Zdenek Kabelac [Mon, 16 Sep 2013 09:18:31 +0000 (11:18 +0200)]
tests: enhance pvmove testing

Rewrite check lv_on  and add new  lv_tree_on
Move more pvmove test unrelated code out to check & get sections
(so they do not obfuscate trace output unnecesserily)

Use new lv_tree_on()
NOTE: unsure how the snapshot origin should be accounted here.

Split pmove-all-segments into separate tests for raid and thins
(so the test output properly shows what has been skipped in test)

11 years agotests: use check for raid test
Zdenek Kabelac [Mon, 16 Sep 2013 09:15:38 +0000 (11:15 +0200)]
tests: use check for raid test

Use test-suite built-in check command for this test
(creates better logs, and reduces amount of valgrind-ed commands)

11 years agotests: update check and get
Zdenek Kabelac [Mon, 16 Sep 2013 09:12:37 +0000 (11:12 +0200)]
tests: update check and get

Update usage of "" around shell vars.
trim needs to trim both sides now.
trim also removes debug.log since it's only called when lvm command
has finished properly (so if something fails afterward, there
is no missleading debug trace in the log)

11 years agotests: update die
Zdenek Kabelac [Mon, 16 Sep 2013 09:05:03 +0000 (11:05 +0200)]
tests: update die

'die' evaluates given string - so \n could be used for
multiline error report

Also remove debug.log since the command finished properly when we
call 'die'

Note: we should not call 'die' after lvm command failure.

11 years agotests: add help function
Zdenek Kabelac [Mon, 16 Sep 2013 09:02:58 +0000 (11:02 +0200)]
tests: add help function

Add mkdev_md5sum to create and checksum given LV.
Add dev_md5sum to verify device has matching md5 sum.

11 years agoTEST: Unaccounted possible output causing failure
Jonathan Brassow [Thu, 12 Sep 2013 18:23:53 +0000 (13:23 -0500)]
TEST: Unaccounted possible output causing failure

lvchange-raid.sh checks to ensure that the 'p'artial flag takes
precedence over the 'w'ritemostly flag by disabling and reenabling
a device in the array.  Most of the time this works fine, but
sometimes the kernel can notice the device failure before it is
reenabled.  In that case, the attr flag will not return to 'w', but
to 'r'efresh.  This is because 'r'efresh also takes precedence over
the 'w'ritemostly flag.  So, we also do a quick check for 'r' and
not just 'w'.

11 years agoWHATS_NEW: some missing lines
Peter Rajnoha [Thu, 12 Sep 2013 12:16:54 +0000 (14:16 +0200)]
WHATS_NEW: some missing lines

11 years agoudev: keep DM_ACTIVATION and DM_UDEV_PRIMARY_SOURCE_FLAG meaning as before commit...
Peter Rajnoha [Thu, 12 Sep 2013 11:46:20 +0000 (13:46 +0200)]
udev: keep DM_ACTIVATION and DM_UDEV_PRIMARY_SOURCE_FLAG meaning as before commit 8d1d835

The DM_ACTIVATION and DM_UDEV_PRIMARY_SOURCE_FLAG needs to be kept the
way it was for backward compatibility (e.g. the old rules are still
in initramfs). This way the check in whether the device should be
scanned in 69-dm-lvmetad.rules is even easier.

11 years agotests: extend harness with output of /var/log/messages
Zdenek Kabelac [Thu, 12 Sep 2013 11:30:12 +0000 (13:30 +0200)]
tests: extend harness with output of /var/log/messages

Add a very simple hack for embeding /var/log/messages into
the tests output - it's not ideal since it sometimes breaks lines,
but still gives valuable info.

11 years agotests: singlenode cleanup for prev commit
Zdenek Kabelac [Thu, 12 Sep 2013 09:29:18 +0000 (11:29 +0200)]
tests: singlenode cleanup for prev commit

Add few more comments and cleanup some warnings.

11 years agotests: singlenode updates
Zdenek Kabelac [Wed, 11 Sep 2013 21:46:20 +0000 (23:46 +0200)]
tests: singlenode updates

Add more 'realistic' simulation of dlm locking.
Previous version was not capable to maintain multiple locks.
Current version doesn't handle multiqueues for locks,
so the ordering is different.

11 years agoclvmd: add missing debug newline
Zdenek Kabelac [Thu, 12 Sep 2013 08:33:51 +0000 (10:33 +0200)]
clvmd: add missing debug newline

Just missing new line.

11 years agocleanup: hide gcc warning
Zdenek Kabelac [Mon, 9 Sep 2013 11:06:05 +0000 (13:06 +0200)]
cleanup: hide gcc warning

Older gcc is giving misleading warning:

metadata/lv_manip.c:4018: warning: â€˜seg’ may be used uninitialized in
this function

But warning free compilation is better.

11 years agoMirror/Thin: Disallow thinpools on mirror logical volumes
Jonathan Brassow [Wed, 11 Sep 2013 20:58:44 +0000 (15:58 -0500)]
Mirror/Thin: Disallow thinpools on mirror logical volumes

The same corner cases that exist for snapshots on mirrors exist for
any logical volume layered on top of mirror.  (One example is when
a mirror image fails and a non-repair LVM command is the first to
detect it via label reading.  In this case, the LVM command will hang
and prevent the necessary LVM repair command from running.)  When
a better alternative exists, it makes no sense to allow a new target
to stack on mirrors as a new feature.  Since, RAID is now capable of
running EX in a cluster and thin is not active-active aware, it makes
sense to pair these two rather than mirror+thinpool.

As further background, here are some additional comments that I made
when addressing a bug related to mirror+thinpool:
(https://bugzilla.redhat.com/show_bug.cgi?id=919604#c9)
I am going to disallow thin* on top of mirror logical volumes.
Users will have to use the "raid1" segment type if they want this.

This bug has come down to a choice between:
1) Disallowing thin-LVs from being used as PVs.
2) Disallowing thinpools on top of mirrors.

The problem is that the code in dev_manager.c:device_is_usable() is unable
to tell whether there is a mirror device lower in the stack from the device
being checked.  Pretty much anything layered on top of a mirror will suffer
from this problem.  (Snapshots are a good example of this; and option #1
above has been chosen to deal with them.  This can also be seen in
dev_manager.c:device_is_usable().)  When a mirror failure occurs, the
kernel blocks all I/O to it.  If there is an LVM command that comes along
to do the repair (or a different operation that requires label reading), it
would normally avoid the mirror when it sees that it is blocked.  However,
if there is a snapshot or a thin-LV that is on a mirror, the above code
will not detect the mirror underneath and will issue label reading I/O.
This causes the command to hang.

Choosing #1 would mean that thin-LVs could never be used as PVs - even if
they are stacked on something other than mirrors.

Choosing #2 means that thinpools can never be placed on mirrors.  This is
probably better than we think, since it is preferred that people use the
"raid1" segment type in the first place.  However, RAID* cannot currently
be used in a cluster volume group - even in EX-only mode.  Thus, a complete
solution for option #2 must include the ability to activate RAID logical
volumes (and perform RAID operations) in a cluster volume group.  I've
already begun working on this.

11 years agoWHATS_NEW: one more for commit 8d1d835
Peter Rajnoha [Wed, 11 Sep 2013 11:15:53 +0000 (13:15 +0200)]
WHATS_NEW: one more for commit 8d1d835

11 years agoWHATS_NEW: for commit 8d1d8350 and 72a9d4f
Peter Rajnoha [Wed, 11 Sep 2013 10:58:43 +0000 (12:58 +0200)]
WHATS_NEW: for commit 8d1d8350 and 72a9d4f

11 years agoudev: override new udev default timeout of 30s to original 3min
Peter Rajnoha [Wed, 11 Sep 2013 10:42:29 +0000 (12:42 +0200)]
udev: override new udev default timeout of 30s to original 3min

New versions of udev changed the default event timeout to 30s
from original 3min. This causes problems with LVM processes that
starve because of the IO load caused by some LVM actions (e.g.
mirror/raid synchronization).

Reinstate the 3min udev timeout for now until we optimize this
in a way that even the 30s timeout is sufficient.

11 years agoRAID: Make RAID single-machine-exclusive capable in a cluster
Jonathan Brassow [Tue, 10 Sep 2013 21:33:22 +0000 (16:33 -0500)]
RAID: Make RAID single-machine-exclusive capable in a cluster

Creation, deletion, [de]activation, repair, conversion, scrubbing
and changing operations are all now available for RAID LVs in a
cluster - provided that they are activated exclusively.

The code has been changed to ensure that no LV or sub-LV activation
is attempted cluster-wide.  This includes the often overlooked
operations of activating metadata areas for the brief time it takes
to clear them.  Additionally, some 'resume_lv' operations were
replaced with 'activate_lv_excl_local' when sub-LVs were promoted
to top-level LVs for removal, clearing or extraction.  This was
necessary because it forces the appropriate renaming actions the
occur via resume in the single-machine case, but won't happen in
a cluster due to the necessity of acquiring a lock first.

The *raid* tests have been updated to allow testing in a cluster.
For the most part, this meant creating devices with '-aey' if they
were to be converted to RAID.  (RAID requires the converting LV to
be EX because it is a condition of activation for the RAID LV in
a cluster.)

11 years agoudev: fix pvscan --cache -aay to trigger on relevant events
Peter Rajnoha [Tue, 10 Sep 2013 13:49:05 +0000 (15:49 +0200)]
udev: fix pvscan --cache -aay to trigger on relevant events

This patch fixes the way the special devices are handled
(special in this context means that they're not usable
after the usual ADD event like other generic devices):

  - DM and MD devices are pvscanned only when they are just set up.
    This is the first CHANGE event that makes the device  usable
    (the DM_UDEV_PRIMARY_SOURCE_FLAG is set for DM and the
     md/array_state sysfs attribute is present for MD).
    Whether the device is activated is remembered via
    DM_ACTIVATED (for DM) and LVM_MD_PV_ACTIVATED (for MD)
    udev environment variable. This is then used to decide
    whether we should fire the pvscan on ADD event to
    support coldplugging. For any (artificial) ADD event
    generated during coldplug, the device must be already
    set up properly to fire the pvscan on it.

  - Similar for loop devices. For loop devices, only CHANGE
    events are relevant (so there's a CHANGE after the loop
    device is set up as well as detached). Whether the loop
    has just been activated is detected via loop/backing_file
    sysfs attribute presence. The activation state is remembered
    via LVM_LOOP_PV_ACTIVATED udev environment variable.

  - Do not pvscan multipath device components (underlying paths).

  - Do not pvscan RAID device components.

  - Also, set LVM_SCANNED="1" udev environment variable for
    debug purposes (it's visible in the lvmdump -u that takes
    the current udev database). This variable is set once
    the pvscan is triggered.

The table below summarises when the pvscan is triggered
(marked with X, X* means fire only if the special dev is properly set up):

      | real ADD | real CHANGE | artificial ADD | artificial CHANGE | remove
=============================================================================
DM    |          |      X      |       X*       |                   |   X
MD    |          |      X      |       X*       |                   |
loop  |          |      X      |       X*       |                   |
other |    X     |             |       X        |                   |   X

11 years agoudev: DM_ID_FS_TYPE should be ID_FS_TYPE when comparing with old value
Peter Rajnoha [Tue, 10 Sep 2013 10:38:18 +0000 (12:38 +0200)]
udev: DM_ID_FS_TYPE should be ID_FS_TYPE when comparing with old value

11 years agoMisc/RAID: Enable resume_lv to handle some renaming conflicts.
Jonathan Brassow [Mon, 9 Sep 2013 20:07:28 +0000 (15:07 -0500)]
Misc/RAID: Enable resume_lv to handle some renaming conflicts.

When images and their associated metadata are removed from a RAID1 LV,
the remaining sub-LVs are "shifted" down to fill the gaps.  For
example, if there is a 3-way mirror:
[0][1][2]
and we remove device#0, the devices will be shifted down
[1][2]
and renamed.
[0][1]

This can create a problem for resume_lv (specifically,
dm_tree_activate_children) during the renaming process though.  This
is because it will attempt to rename the higher indexed sub-LVs first
and find that it cannot because there are currently other sub-LVs with
that name.  The solution is to check for a conflicting name before
attempting to rename.  If a conflict is found and that conflicting
sub-LV is also in the process of renaming, we can defer the current
rename until the conflicting sub-LV has renamed and cleared the
conflict.

Now that resume_lv can handle these types of rename conflicts, we can
remove the workaround in RAID that was attempting to resume a RAID1
LV from the bottom-up in order to force a proper rename in assending
order before attempting a resume on the top-level LV.  This "hack"
only worked for single machine use-cases of LVM.  Clearing this up
paves the way for exclusive activation of RAID LVs in a cluster.

11 years agoudev: also inform lvmetad about lost LVM1 PV label
Peter Rajnoha [Mon, 9 Sep 2013 11:47:25 +0000 (13:47 +0200)]
udev: also inform lvmetad about lost LVM1 PV label

Addendum to 4d3b5724e0b51782000a45027de00e0fed1c9833
which covered only LVM2 PV labels.

11 years agocleanup: drop within comment gcc warning
Zdenek Kabelac [Mon, 9 Sep 2013 10:15:48 +0000 (12:15 +0200)]
cleanup: drop within comment gcc warning

toollib.c:69:24: warning: "/*" within comment

11 years agotest: timeout when no write happens since last written line
Zdenek Kabelac [Mon, 9 Sep 2013 10:14:00 +0000 (12:14 +0200)]
test: timeout when no write happens since last written line

Change current test abort after 3 minutes, to abort after 3 minutes
without written output line.

11 years agodeactivate: drop readahead calc in deactivation
Zdenek Kabelac [Sat, 7 Sep 2013 00:48:19 +0000 (02:48 +0200)]
deactivate: drop readahead calc in deactivation

Skip readahead when device will be deactivated.

11 years agothin: validation catch multiseg thin pool/volumes
Zdenek Kabelac [Fri, 6 Sep 2013 12:07:39 +0000 (14:07 +0200)]
thin: validation catch multiseg thin pool/volumes

Multisegment thin pools and volumes are not supported.
Catch such error code path early.

11 years agothin: fix monitoring of thin pool volume
Zdenek Kabelac [Sat, 7 Sep 2013 00:46:48 +0000 (02:46 +0200)]
thin: fix monitoring of thin pool volume

Properly skip unmonitoring of thin pool volume in deactivation code
path. Code makes sure if there is just any thin pool user
it stays monitored with all its resources.

11 years agothin: fix resize of stacked thin pool volume
Zdenek Kabelac [Fri, 6 Sep 2013 08:54:50 +0000 (10:54 +0200)]
thin: fix resize of stacked thin pool volume

When the pool is created from non-linear target the more complex rules
have to be used and stacking needs to properly decode args for _tdata
LV. Also proper allocation policies are being used according to those
set in lvm2 metadata for data and metadata LVs.

Also properly check for active pool and extra code to active it
temporarily.

With this fix it's now possible to use:

lvcreate -L20 -m2 -n pool vg  --alloc anywhere
lvcreate -L10 -m2 -n poolm vg --alloc anywhere
lvconvert --thinpool vg/pool --poolmetadata vg/poolm

lvresize -L+10 vg/pool

11 years agotest: Add the 64b fc17 kernel to the mirror recovery blacklist.
Petr Rockai [Fri, 6 Sep 2013 14:35:49 +0000 (16:35 +0200)]
test: Add the 64b fc17 kernel to the mirror recovery blacklist.

11 years agotoollib: tweak background forking
Alasdair G Kergon [Fri, 6 Sep 2013 00:49:43 +0000 (01:49 +0100)]
toollib: tweak background forking

Log what is forked and replace #if 1 with DEBUG_CHILD.

11 years agologging: Write Completed message before resetting.
Alasdair G Kergon [Fri, 6 Sep 2013 00:47:41 +0000 (01:47 +0100)]
logging: Write Completed message before resetting.

11 years agotools: Use backgroundfork_ARG for pvscan -b
Alasdair G Kergon [Fri, 6 Sep 2013 00:43:24 +0000 (01:43 +0100)]
tools: Use backgroundfork_ARG for pvscan -b

Change pvscan -b to use a new backgroundfork_ARG instead of
background_ARG so as not to affect pvmove -b and lvconvert -b.

11 years agotest: Include tests that timed out in the final summary.
Petr Rockai [Wed, 4 Sep 2013 14:20:35 +0000 (16:20 +0200)]
test: Include tests that timed out in the final summary.

11 years agopvmove: Skip pvmove of RAID, thin, snapshot, origin, and mirror LVs in cluster
Jonathan Brassow [Tue, 3 Sep 2013 18:17:01 +0000 (13:17 -0500)]
pvmove: Skip pvmove of RAID, thin, snapshot, origin, and mirror LVs in cluster

pvmove of the above types should only have been enabled in single machine
mode.

11 years agotest: Fix a spurious failure in skip_if_mirror_recovery_broken.
Petr Rockai [Tue, 3 Sep 2013 18:05:22 +0000 (20:05 +0200)]
test: Fix a spurious failure in skip_if_mirror_recovery_broken.

11 years agoTEST: pvmove-all-segtypes.sh should not be run in a cluster
Jonathan Brassow [Tue, 3 Sep 2013 15:51:21 +0000 (10:51 -0500)]
TEST: pvmove-all-segtypes.sh should not be run in a cluster

11 years agoreinstate: commit 82d83a01ce2cac77fec2e9b763061fbfb5f01ce8
Peter Rajnoha [Tue, 3 Sep 2013 14:45:18 +0000 (16:45 +0200)]
reinstate: commit 82d83a01ce2cac77fec2e9b763061fbfb5f01ce8

It now works as supposed. The source of the problem is fixed
by previous commit d2d6a9da52e04f28e1916bcea3f9fda356b6df29.

11 years agotools: add -b/--background for pvscan --cache -aay
Peter Rajnoha [Tue, 3 Sep 2013 14:06:16 +0000 (16:06 +0200)]
tools: add -b/--background for pvscan --cache -aay

Udev daemon has recently introduced a limit on the number of udev
processes (there was no limit before). This causes a problem
when calling pvscan --cache -aay in lvmetad udev rules which
is supposed to activate the volumes. This activation is itself
synced with udev and so it waits for the activation to complete
before the pvscan finishes. The event processing can't continue
until this pvscan call is finished.

But if we're at the limit with the udev process count, we can't
instatiate any more udev processes, all such events are queued
and so we can't process the lvm activation event for which the
pvscan is waiting.

Then we're in a deadlock since the udev process with the
pvscan --cache -aay call waits for the lvm activation udev
processing to complete, but that will never happen as there's
this limit hit with the number of udev processes.

The process with pvscan --cache -aay actually times out eventually
(3min or 30sec, depends on the version of udev).

This patch makes it possible to run the pvscan --cache -aay
in the background so the udev processing can continue and hence
we can avoid the deadlock mentioned above.

11 years agotest: Skip tests involving mirror recovery on known bad kernels.
Petr Rockai [Tue, 3 Sep 2013 13:49:14 +0000 (15:49 +0200)]
test: Skip tests involving mirror recovery on known bad kernels.

11 years agopvscan: show -aay with --cache for help
Peter Rajnoha [Tue, 3 Sep 2013 07:51:30 +0000 (09:51 +0200)]
pvscan: show -aay with --cache for help

11 years agorevert: commit 82d83a01ce2cac77fec2e9b763061fbfb5f01ce8
Peter Rajnoha [Mon, 2 Sep 2013 11:46:49 +0000 (13:46 +0200)]
revert: commit 82d83a01ce2cac77fec2e9b763061fbfb5f01ce8

The commit 82d83a01ce2cac77fec2e9b763061fbfb5f01ce8
"autoactivation: refresh existing VG before autoactivation"
causes problems (dangling udev_sync cookies, slow processing
of the pvscan --cache --major --minor call from udev rules)
when the autoactivation handler is run in parallel on
several PVs that belong to the same VG. Revert this patch
until the exact source of the problem is found and then
properly fixed and handled.

11 years agotests: test pvmove behavior after restart
Zdenek Kabelac [Fri, 30 Aug 2013 12:53:57 +0000 (14:53 +0200)]
tests: test pvmove behavior after restart

Simulate crash of the system and restarted pvmove after next VG
activation.

Test is catching regression introduced in 2.02.99 for partial tree
creation changes.

11 years agotests: add delay_dev
Zdenek Kabelac [Fri, 30 Aug 2013 12:50:58 +0000 (14:50 +0200)]
tests: add delay_dev

Function to create slower responsive device.

Useful for testing things which needs to happen something during on
going operation - with  'delayed' device - much smaller sizes of devices
are needed and its much more deterministic (though still not optimal)

11 years agolibdm: new name can't be empty
Zdenek Kabelac [Fri, 30 Aug 2013 12:46:34 +0000 (14:46 +0200)]
libdm: new name can't be empty

Do not allow passing '' names to kernel.

This test was missing also in kernel, so it has allowed
to create device with '' name.  This then confused dmsetup tool,
since such name is unexpected and unsupported. To remove
such name from table, user has to use -j -m to specify which device
should be removed.

This patch fixes the posibility to run this operation:

dmsetup rename existingdev ''

after this operation commands like  'dmsetup table' are failing.
This patch prohibits to use such name.

11 years agotest: fix process-each-duplicate-vgnames
David Teigland [Fri, 30 Aug 2013 16:45:12 +0000 (11:45 -0500)]
test: fix process-each-duplicate-vgnames

After enable_dev, the following commands were not
consistently seeing the pv on it.

Alasdair explained, "whenever enabling/disabling devs
outside the tools (and you aren't trying to test how
the tools cope with suddenly appearing/disappering
devices) use "vgscan""

11 years agoman: lvmdump -u -l
Peter Rajnoha [Thu, 29 Aug 2013 12:20:57 +0000 (14:20 +0200)]
man: lvmdump -u -l

11 years agotoolcontext: Only reopen stdin if readable.
Alasdair G Kergon [Wed, 28 Aug 2013 22:55:14 +0000 (23:55 +0100)]
toolcontext: Only reopen stdin if readable.

Don't fail when running lvm commands under versions of nohup that set
up stdin as O_WRONLY!

11 years agoactivation: Fix segfault with inactive pvmove LV.
Alasdair G Kergon [Wed, 28 Aug 2013 21:56:23 +0000 (22:56 +0100)]
activation: Fix segfault with inactive pvmove LV.

Set flag to avoid recursion back through an inactive pvmove LV when
populating deptree.

11 years agosystemd: lvm2-activation-generator: remove default dir if args not specified and...
Peter Rajnoha [Wed, 28 Aug 2013 14:06:51 +0000 (16:06 +0200)]
systemd: lvm2-activation-generator: remove default dir if args not specified and require all args to be given

Remove default "/tmp" as destination directory if no args
specified for lvm2-activation-generator. Require all the
args to be specified directly for proper functionality.

11 years agoman: lvmdump: add doc for -l and -u
Peter Rajnoha [Wed, 28 Aug 2013 12:57:34 +0000 (14:57 +0200)]
man: lvmdump: add doc for -l and -u

11 years agotest: Set the timeout to 3 minutes (was 5s accidentally).
Petr Rockai [Fri, 23 Aug 2013 16:11:22 +0000 (18:11 +0200)]
test: Set the timeout to 3 minutes (was 5s accidentally).

11 years agotest: Add a new "check_full" target, which also tests with real /dev.
Petr Rockai [Fri, 23 Aug 2013 08:09:23 +0000 (10:09 +0200)]
test: Add a new "check_full" target, which also tests with real /dev.

The original "check" target stays confined to a local device directory, while
check_full does 6 flavours, 3 with a local device directory and 3 with the
global /dev directory (the latter are prefixed with "s" for
"system"). I.e.: normal, cluster, lvmetad, snormal, scluster, slvmetad.

11 years agotest: Check for flavoured variables earlier.
Petr Rockai [Fri, 23 Aug 2013 08:06:14 +0000 (10:06 +0200)]
test: Check for flavoured variables earlier.

This is necessary to make LVM_TEST_DEVDIR flavourable, and in turn have flavours
that use the global /dev (which can in turn be managed by udev).

11 years agotest: Remove a redundant drain() from the timeout path.
Petr Rockai [Mon, 5 Aug 2013 19:12:39 +0000 (21:12 +0200)]
test: Remove a redundant drain() from the timeout path.

11 years agotest: Make timeouts a little more robust & verbose.
Petr Rockai [Mon, 5 Aug 2013 19:11:49 +0000 (21:11 +0200)]
test: Make timeouts a little more robust & verbose.

11 years agoTEST: Add a timeout to the harness, killing tests after 2 minutes.
Petr Rockai [Tue, 23 Jul 2013 09:42:34 +0000 (11:42 +0200)]
TEST: Add a timeout to the harness, killing tests after 2 minutes.

11 years agoTEST: Add tests for lvchange actions of RAID under thin
Jonathan Brassow [Tue, 27 Aug 2013 21:46:40 +0000 (16:46 -0500)]
TEST: Add tests for lvchange actions of RAID under thin

Patch includes RAID1,4,5,6,10 tests for:
- setting writemostly/writebehind
* syncaction changes (i.e. scrubbing operations)
- refresh (i.e. reviving devices after transient failures)
- setting recovery rate (sync I/O throttling)
while the RAID LVs are under a thin-pool (both data and metadata)

* not fully tested because I haven't found a way to force bad
  blocks to be noticed in the testsuite yet.  Works just fine
  when dealing with "real" devices.

11 years agotest: pvmove tests for all the different segment types.
Jonathan Brassow [Mon, 26 Aug 2013 21:38:54 +0000 (16:38 -0500)]
test: pvmove tests for all the different segment types.

Test moving linear, mirror, snapshot, RAID1,5,10, thinpool, thin
and thin on RAID.  Perform the moves along with a dummy LV and
also without the dummy LV by specifying a logical volume name as
an argument to pvmove.

11 years agopvmove: Allow moving snapshot/origin. Disallow converting and merging LVs
Jonathan Brassow [Mon, 26 Aug 2013 21:36:30 +0000 (16:36 -0500)]
pvmove:  Allow moving snapshot/origin.  Disallow converting and merging LVs

The patch allows the user to also pvmove snapshots and origin logical
volumes.  This means pvmove should be able to move all segment types.
I have, however, disallowed moving converting or merging logical volumes.

11 years agopvmove: Fix inability to specify LV name when moving RAID, mirror, or thin LV
Jonathan Brassow [Mon, 26 Aug 2013 19:12:31 +0000 (14:12 -0500)]
pvmove: Fix inability to specify LV name when moving RAID, mirror, or thin LV

Top-level LVs (like RAID, mirror or thin) are ignored when determining which
portions of an LV to pvmove.  If the user specified the name of an LV to
move and it was one of the above types, it would be skipped.  The code would
never move on to check whether its sub-LVs needed moving because their names
did not match what the user specified.

The solution is to check whether a sub-LVs is part of the LV whose name was
specified by the user - not just if there was a name match.

11 years agoWHATS_NEW: for 4d3b5724e0b51782000a45027de00e0fed1c9833
Peter Rajnoha [Mon, 26 Aug 2013 13:52:15 +0000 (15:52 +0200)]
WHATS_NEW: for 4d3b5724e0b51782000a45027de00e0fed1c9833

11 years agoudev: inform lvmetad about lost PV label
Peter Rajnoha [Mon, 26 Aug 2013 13:27:00 +0000 (15:27 +0200)]
udev: inform lvmetad about lost PV label

In stacked environment where we have a PV layered on top of a
snapshot LV and then removing the LV, lvmetad still keeps information
about the PV:

[0] raw/~ $ pvcreate /dev/sda
  Physical volume "/dev/sda" successfully created
[0] raw/~ $ vgcreate vg /dev/sda
  Volume group "vg" successfully created
[0] raw/~ $ lvcreate -L32m vg
  Logical volume "lvol0" created
[0] raw/~ $ lvcreate -L32m -s vg/lvol0
  Logical volume "lvol1" created
[0] raw/~ $ pvcreate /dev/vg/lvol1
  Physical volume "/dev/vg/lvol1" successfully created
[0] raw/~ $ lvremove -ff vg/lvol1
  Logical volume "lvol1" successfully removed
[0] raw/~ $ pvs
  No device found for PV BdNlu2-7bHV-XcIp-mFFC-PPuR-ef6K-yffdzO.
  PV         VG         Fmt  Attr PSize   PFree
  /dev/sda   vg         lvm2 a--  124.00m 92.00m
[0] raw/~ $ pvscan --cache --major 253 --minor 3
  Device 253:3 not found. Cleared from lvmetad cache.

This is because of the reactivation that is done just before
snapshot removal as part of the process (vg/lvol1 from the example above).
This causes a CHANGE event to be generated, but any scan done
on the LV does not see the original data anymore (in this case
the stacked PV label on top) and consequently the ID_FS_TYPE="LVM2_member"
(provided by blkid scan) is not stored in udev db anymore for the LV.
Consequently, the pvscan --cache is not run anymore as the dev is not
identified as LVM PV by the "LVM2_member" id - lvmetad loses this info
and still keeps records about the PV.

We can run into a very similar problem with erasing the PV label directly:

[0] raw/~ $ lvcreate -L32m vg
  Logical volume "lvol0" created
[0] raw/~ $ pvcreate /dev/vg/lvol0
  Physical volume "/dev/vg/lvol0" successfully created
[0] raw/~ $ dd if=/dev/zero of=/dev/vg/lvol0 bs=1M
dd: error writing '/dev/vg/lvol0': No space left on device
33+0 records in
32+0 records out
33554432 bytes (34 MB) copied, 0.380921 s, 88.1 MB/s
[0] raw/~ $ pvs
  PV            VG         Fmt  Attr PSize   PFree
  /dev/sda      vg         lvm2 a--  124.00m 92.00m
  /dev/vg/lvol0            lvm2 a--   32.00m 32.00m
[0] raw/~ $ pvscan --cache --major 253 --minor 2
  No PV label found on /dev/vg/lvol0.

This patch adds detection of this change from ID_FS_LABEL="LVM2_member"
to ID_FS_LABEL="<whatever_else>" and hence informing the lvmetad
about PV being gone.

11 years agothin: support lvchange for data and metadata
Zdenek Kabelac [Fri, 9 Aug 2013 23:13:27 +0000 (01:13 +0200)]
thin: support lvchange for data and metadata

Support lvchange operation on stacked thin pool data and metadata
volumes.

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