]> sourceware.org Git - lvm2.git/log
lvm2.git
10 years agosystemd: add systemd unit for cmirrord
Peter Rajnoha [Tue, 11 Feb 2014 08:55:57 +0000 (09:55 +0100)]
systemd: add systemd unit for cmirrord

10 years agoautoreconf: latest changes
Peter Rajnoha [Mon, 10 Feb 2014 18:02:18 +0000 (19:02 +0100)]
autoreconf: latest changes

10 years agoAdd systemd native service for clvmd and cluster activation
Ondrej Kozina [Mon, 10 Feb 2014 16:05:10 +0000 (17:05 +0100)]
Add systemd native service for clvmd and cluster activation

The commit splits original clvmd service in two new native services
for systemd enabled systems while original init scripts remain unaltered.

New systemd native services:

  1) clvmd daemon itself (lvm2_clvmd_red_hat.service.in)
  2) (de)activation of clustered VGs (lvm2_cluster_activation_red_hat.service.in)

There're several reasons to split it. First, there's no support for conditional
stop in systemd and AFAIK they don't plan to support it. In other words:
if the deactivation fails for some reason, systemd doesn't care and will simply
kill all remaining processes in original cgroup (by default). Killing the
remaining procs can be suppressed however it doesn't solve the following problem:

You can't repeat the stop command of a failed service. The repeated stop command
is simply not propagated to the service in a failed state. You would have to start
and then try to stop the service again. Unfortunately, this can't be done while
the daemon is still running (and we need the daemon to stay active until all
clustered VGs are deactivated properly).

In a separated setup we need only to restart the failed activation service and
that's fine.

10 years agosystemd: cleanup for lvmetad systemd unit
Peter Rajnoha [Mon, 10 Feb 2014 15:18:48 +0000 (16:18 +0100)]
systemd: cleanup for lvmetad systemd unit

No need to fork lvmetad when running under systemd.
Also, the "lvmetad -R" support has been removed in lvm2 v2.02.98
so remove the ExecReload line that called it on "systemctl reload".

10 years agolibdevmapper-event: Print a deprecation warning for non-default plugins.
Petr Rockai [Mon, 10 Feb 2014 13:51:14 +0000 (14:51 +0100)]
libdevmapper-event: Print a deprecation warning for non-default plugins.

10 years agowiping: wipe DM_snapshot_cow signature without prompt in newly created LVs
Peter Rajnoha [Mon, 10 Feb 2014 12:28:13 +0000 (13:28 +0100)]
wiping: wipe DM_snapshot_cow signature without prompt in newly created LVs

The libblkid can detect DM_snapshot_cow signature and when creating
new LVs with blkid wiping used (allocation/use_blkid_wiping=1 lvm.conf
setting and --wipe y used at the same time - which it is by default).

Do not issue any prompts about this signature when new LV is created
and just wipe it right away without asking questions. Still keep the
log in verbose mode though.

10 years agocleanup: missing parentheses in a condition
Peter Rajnoha [Mon, 10 Feb 2014 08:03:08 +0000 (09:03 +0100)]
cleanup: missing parentheses in a condition

gcc reports:
  metadata/merge.c:229:58: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
  metadata/merge.c:232:58: warning: suggest parentheses around '&&' within '||' [-Wparentheses]

10 years agoWHATS_NEW: latest commits
Peter Rajnoha [Thu, 6 Feb 2014 17:19:24 +0000 (18:19 +0100)]
WHATS_NEW: latest commits

10 years agodmeventd: check pidfile for exit instead of polling via protocol
Peter Rajnoha [Thu, 6 Feb 2014 16:53:03 +0000 (17:53 +0100)]
dmeventd: check pidfile for exit instead of polling via protocol

Since we use unlink + _exit now on dmeventd DIE message, we can
check the pidfile existence to see whether the dmeventd has finished.

10 years agodmeventd: use _exit(0) instead of raise(9) on dmeventd DIE message
Peter Rajnoha [Thu, 6 Feb 2014 10:44:57 +0000 (11:44 +0100)]
dmeventd: use _exit(0) instead of raise(9) on dmeventd DIE message

Just a cleaner way to die.

10 years agodmeventd: add DM_EVENT_GET_PARAMETERS request to dmeventd protocol
Peter Rajnoha [Tue, 4 Feb 2014 16:01:54 +0000 (17:01 +0100)]
dmeventd: add DM_EVENT_GET_PARAMETERS request to dmeventd protocol

The DM_EVENT_GET_PARAMETERS requests the parameters under which
the running dmeventd is run and the it sends them to caller.

The parameters sent:
  - the pid of the running dmeventd
  - foreground state
  - exec_method (currently either "direct" or "systemd")

The exact message sent back:
  pid=<pid> daemon=<no/yes> exec_method=<direct/systemd>

10 years agodmeventd: fix dmeventd -R to work properly with systemd
Peter Rajnoha [Mon, 3 Feb 2014 15:07:06 +0000 (16:07 +0100)]
dmeventd: fix dmeventd -R to work properly with systemd

Trying to restart dmeventd as a reload action is causing problems
under systemd environment. The systemd loses track of new dmeventd
this way. See also https://bugzilla.redhat.com/show_bug.cgi?id=1060134
for more info.

We need to call dmeventd -R directly instead of "systemctl reload dm-event.service"
that was used before (the reload is aimed at configuration reload anyway,
not stateful restart of the daemon - we did this before just because
there's no ExecRestart in systemd and there's only ExecStart and
ExecStop with which we'd lose the state).

Also, use ExecStart="dmeventd -f" to run dmeventd in foreground
(and let's rely on systemd to daemonize it) and change the
service type from "forking" to "simple".

10 years agocache[pool]: Populate existing report fields with cache data
Jonathan Brassow [Wed, 5 Feb 2014 15:44:37 +0000 (09:44 -0600)]
cache[pool]:  Populate existing report fields with cache data

For the report fields that already exist that are relevent to cache
and cache pool LVs (like 'origin', 'metadata_lv', etc), populate
them.

10 years agocache: Code to allow the create/remove of cache LVs
Jonathan Brassow [Tue, 4 Feb 2014 22:50:16 +0000 (16:50 -0600)]
cache: Code to allow the create/remove of cache LVs

This patch allows users to create cache LVs with 'lvcreate'.  An origin
or a cache pool LV must be created first.  Then, while supplying the
origin or cache pool to the lvcreate command, the cache can be created.

Ex1:
Here the cache pool is created first, followed by the origin which will
be cached.
~> lvcreate --type cache_pool -L 500M -n cachepool vg /dev/small_n_fast
~> lvcreate --type cache -L 1G -n lv vg/cachepool /dev/large_n_slow

Ex2:
Here the origin is created first, followed by the cache pool - allowing
a cache LV to be created covering the origin.
~> lvcreate -L 1G -n lv vg /dev/large_n_slow
~> lvcreate --type cache -L 500M -n cachepool vg/lv /dev/small_n_fast

The code determines which type of LV was supplied (cache pool or origin)
by checking its type.  It ensures the right argument was given by ensuring
that the origin is larger than the cache pool.

If the user wants to remove just the cache for an LV.  They specify
the LV's associated cache pool when removing:
~> lvremove vg/cachepool

If the user wishes to remove the origin, but leave the cachepool to be
used for another LV, they specify the cache LV.
~> lvremove vg/lv

In order to remove it all, specify both LVs.

This patch also includes tests to create and remove cache pools and
cache LVs.

10 years agocache: Code changes to allow creation of cache pools
Jonathan Brassow [Tue, 4 Feb 2014 17:57:08 +0000 (11:57 -0600)]
cache: Code changes to allow creation of cache pools

This patch allows the creation and removal of cache pools.  Users are not
yet able to create cache LVs.  They are only able to define the space used
for the cache and its characteristics (chunk_size and cache mode ATM) by
creating the cache pool.

10 years agocache pool: Add 'update_cache_pool_params'
Jonathan Brassow [Tue, 4 Feb 2014 17:50:27 +0000 (11:50 -0600)]
cache pool: Add 'update_cache_pool_params'

Similar function to 'update_thin_pool_params', but for cache.  Performs
the adjustements for chunk_size, metdata device size, etc.

10 years agomisc: disambiguate 'update_pool_params'
Jonathan Brassow [Tue, 4 Feb 2014 15:58:35 +0000 (09:58 -0600)]
misc: disambiguate 'update_pool_params'

s/update_pool_params/update_thin_pool_params/ to disambiguate it from
a future 'update_cache_pool_params'.

10 years agomisc: rename variables [min|max]_chunk to [min|max]_chunk_size
Jonathan Brassow [Tue, 4 Feb 2014 14:20:10 +0000 (08:20 -0600)]
misc: rename variables [min|max]_chunk to [min|max]_chunk_size

better variable names.

10 years agocache: Add functions that create/remove cache LVs
Jonathan Brassow [Tue, 4 Feb 2014 13:59:58 +0000 (07:59 -0600)]
cache: Add functions that create/remove cache LVs

A cache LV - from LVM's perpective - is a user accessible device that
links the cachepool LV and the origin LV.  The following functions
were added to facilitate the creation and removal of this top-level
LV:
1) 'lv_cache_create' - takes a cachepool and an origin device and links
   them into a new top-level LV of 'cache' segment type.  No allocation
   is necessary in this function, as the sub-LVs contain all of the
   necessary allocated space.  Only the top-level layer needs to be
   created.

2) 'lv_cache_remove' - this function removes the top-level LV of a
   cache LV - promoting the cachepool and origin sub-LVs to top-level
   devices and leaving them exposed to the user.  That is, the
   cachepool is unlinked and free to be used with another origin to
   form a new cache LV; and the origin is no longer cached.
   (Currently, if the cache needs to be flushed, it is done in this
   function and the function waits for it to complete before proceeding.
   This will be taken out in a future patch in favor of polling.)

10 years agoraid: add temporary activation for raid metadata clear
Zdenek Kabelac [Tue, 4 Feb 2014 13:47:52 +0000 (14:47 +0100)]
raid: add temporary activation for raid metadata clear

Use LV_TEMPORARY when activating devices for clearing
raid metadata.

10 years agotests: update test
Zdenek Kabelac [Mon, 3 Feb 2014 17:26:55 +0000 (18:26 +0100)]
tests: update test

Remove some unneeded traces and outputs.

10 years agopool: Make another thin pool fn generic for cache usage also
Jonathan Brassow [Tue, 4 Feb 2014 13:03:52 +0000 (07:03 -0600)]
pool: Make another thin pool fn generic for cache usage also

Make '_recalculate_thin_pool_chunk_size_with_dev_hints' so it can
be used for cache and thin pools.

10 years agomisc: Fix copy+paste error
Jonathan Brassow [Fri, 31 Jan 2014 23:09:47 +0000 (17:09 -0600)]
misc: Fix copy+paste error

'cache_pool_metadata_require_separate_pvs' was added in version 2.02.106
not 2.02.89.

10 years agocompilation: Rename tags variables to tagsl.
Alasdair G Kergon [Thu, 30 Jan 2014 21:09:28 +0000 (21:09 +0000)]
compilation: Rename tags variables to tagsl.

10 years agotools: Add internal tags command.
Alasdair G Kergon [Thu, 30 Jan 2014 13:09:15 +0000 (13:09 +0000)]
tools: Add internal tags command.

10 years agocache/pool: Make the fns in pool_manip.c work with cache pools
Jonathan Brassow [Tue, 28 Jan 2014 18:25:07 +0000 (12:25 -0600)]
cache/pool: Make the fns in pool_manip.c work with cache pools

The functions in pool_manip.c are specific to thin pools.  It's
now time to make them more generic and able to handle cache pools
as well.

10 years agocache: Allocation code changes necessary to support cache_pool
Jonathan Brassow [Tue, 28 Jan 2014 18:25:02 +0000 (12:25 -0600)]
cache:  Allocation code changes necessary to support cache_pool

Cache pools require a data and metadata area (like thin pools).  Unlike
thin pool, if 'cache_pool_metadata_require_separate_pvs' is not set to
'1', the metadata and data area will be allocated from the same device.
It is also done in a manner similar to RAID, where a single chunk of
space is allocated and then split to form the metadata and data device -
ensuring that they are together.

10 years agocache: New functions for gathering info on cache devices
Jonathan Brassow [Tue, 28 Jan 2014 18:24:51 +0000 (12:24 -0600)]
cache: New functions for gathering info on cache devices

Building on the new DM function that parses DM cache status, we
introduce the following LVM level functions to aquire information
about cache devices:
- lv_cache_block_info: retrieves information on the cache's block/chunk usage
- lv_cache_policy_info: retrieves information on the cache's policy

10 years agocache/misc: Revert commit 94377dfd
Jonathan Brassow [Tue, 28 Jan 2014 17:26:05 +0000 (11:26 -0600)]
cache/misc: Revert commit 94377dfd

I am reverting the commit below - removing the new 'dm_config_get_int'
function and simply calling 'dm_config_get_uint32' while casting the
'int *' pointer parameter.

Commit being reverted:
commit 94377dfd5ee7bbbdeb8836eeeea2198bc32c07f5
Author: Jonathan Brassow <jbrassow@redhat.com>
Date:   Mon Jan 27 05:26:19 2014 -0600

    Misc: New function for reading lvm config file fields

    Introduce 'dm_config_get_int', which will be used by the upcoming
    cachepool segment type.

10 years agotests: validate acceptable external origin size
Zdenek Kabelac [Wed, 29 Jan 2014 13:23:50 +0000 (14:23 +0100)]
tests: validate acceptable external origin size

10 years agothin: validate external origin size
Zdenek Kabelac [Wed, 29 Jan 2014 13:27:13 +0000 (14:27 +0100)]
thin: validate external origin size

Avoid use of external origin with size unaligned/incompatible with
thin pool chunk size, since the last chunk is not correctly provisioned
when it is overwritten.

10 years agothin:drop stack trace when pool is above threshold
Zdenek Kabelac [Wed, 29 Jan 2014 13:26:06 +0000 (14:26 +0100)]
thin:drop stack trace when pool is above threshold

Since this path is expected, do not log_debug stacktrace.

10 years agocleanup: fix cut&paste and move initialization
Zdenek Kabelac [Wed, 29 Jan 2014 07:58:50 +0000 (08:58 +0100)]
cleanup: fix cut&paste and move initialization

Use C initializers and fix cut&paste core_arg error.

(in release fix)

10 years agothin: more validation of thin name
Zdenek Kabelac [Tue, 28 Jan 2014 12:21:39 +0000 (13:21 +0100)]
thin: more validation of thin name

Avoid starting conversion of the LV to the thin pool and thin volume
at the same time.  Since this is mostly a user mistake, do not try
to just convert to one of those type, since we cannot assume if the
user wanted LV to become thin volume or thin pool.

Before the fix tool reported pretty strange internal error:
Internal error: Referenced LV lvol1_tdata not listed in VG mvg.

Fixed output:
lvconvert --thinpool lvol0 -T mvg/lvol0
Can't use same LV mvg/lvol0 for thin pool and thin volume.

10 years agotests: check for mkfs
Zdenek Kabelac [Tue, 28 Jan 2014 08:54:22 +0000 (09:54 +0100)]
tests: check for mkfs

Test mkfs.ext3 presence for test.
Test also on singlenode cluster.
Speed up a bit slowed down device.

10 years agothin: disable extension of reduced thin with etx.origin
Zdenek Kabelac [Tue, 28 Jan 2014 09:24:50 +0000 (10:24 +0100)]
thin: disable extension of reduced thin with etx.origin

Since we are currently incapable of providing zeroes for
reextended thin volume area, let's disable extension of
such already reduce thin volumes.

(in-release change)

10 years agodevices: support zvol
Zdenek Kabelac [Mon, 27 Jan 2014 12:13:32 +0000 (13:13 +0100)]
devices: support zvol

Support partitions on ZFS zvol.
Requested via https://bugzilla.redhat.com/show_bug.cgi?id=913597

Author: hakimian@aha.com

10 years agocache: Add DM interface for retrieving a cache's status
Jonathan Brassow [Mon, 27 Jan 2014 11:30:10 +0000 (05:30 -0600)]
cache:  Add DM interface for retrieving a cache's status

This patch defines a structure for holding all of the device-mapper
cache target's status information.  The associated function provides
an easy way for higher levels (LVM) to consume the information.

This patch finishes the device-mapper interface for the cache and
cachepool segment types (i.e. the cache target).

10 years agocache: New 'cache' segment type
Jonathan Brassow [Mon, 27 Jan 2014 11:29:35 +0000 (05:29 -0600)]
cache:  New 'cache' segment type

This patch adds the cache segment type - the second of two necessary
to create cache logical volumes.  This segment type references the
cachepool (the small fast device) and the origin (the large slow device);
linking them to create the cache device.  The cache device is the
hierarchical device-mapper device that the user ulitmately makes use
of.

The cache segment sources the information necessary to construct the
device-mapper cache target from the origin and cachepool segments to
which it links.

10 years agocache: New 'cachepool' segment type
Jonathan Brassow [Mon, 27 Jan 2014 11:27:16 +0000 (05:27 -0600)]
cache:  New 'cachepool' segment type

This patch adds the new cachepool segment type - the first of two
necessary to eventually create 'cache' logical volumes.  In addition
to the new segment type, updates to makefiles, configure files, the
lv_segment struct, and some necessary libdevmapper flags.

The cachepool is the LV and corresponding segment type that will hold
all information pertinent to the cache itself - it's size, cachemode,
cache policy, core arguments (like migration_threshold), etc.

10 years agoMisc: New function for reading lvm config file fields
Jonathan Brassow [Mon, 27 Jan 2014 11:26:19 +0000 (05:26 -0600)]
Misc: New function for reading lvm config file fields

Introduce 'dm_config_get_int', which will be used by the upcoming
cachepool segment type.

10 years agolocking: avoid dropping locks
Zdenek Kabelac [Mon, 27 Jan 2014 11:11:09 +0000 (12:11 +0100)]
locking: avoid dropping locks

When lvm2 command forks, it calls reset_locking(),
which as an unwanted side effect unlinked lock file from filesystem.

Patch changes the behavior to just close locked file descriptor
in children - so the lock is being still properly hold in the parent.

10 years agolvmetad: respect LVM_LVMETAD_PIDFILE settings in lvm
Zdenek Kabelac [Fri, 24 Jan 2014 14:59:38 +0000 (15:59 +0100)]
lvmetad: respect LVM_LVMETAD_PIDFILE settings in lvm

Test LVM_LVMETAD_PIDFILE for pid for lvm command.
Fix WHATS_NEW envvar name usage
Fix init order in prepare_lvmetad to respect set vars
and avoid clash with system settings.
Update test to really test the 'is running' message.

10 years agothin: fix missing ~ in previous commit
Zdenek Kabelac [Fri, 24 Jan 2014 12:13:37 +0000 (13:13 +0100)]
thin: fix missing ~ in previous commit

10 years agothin: use LV_TEMPORARY for metadata initialization
Zdenek Kabelac [Fri, 24 Jan 2014 11:28:35 +0000 (12:28 +0100)]
thin: use LV_TEMPORARY for metadata initialization

This flag need to be specified when we create thin pool - to avoid
scanning device with watch rules.

10 years agocleanup: indent
Zdenek Kabelac [Fri, 24 Jan 2014 09:49:31 +0000 (10:49 +0100)]
cleanup: indent

10 years agoTypo: s/Unale/Unable/
Jonathan Brassow [Thu, 23 Jan 2014 05:04:27 +0000 (23:04 -0600)]
Typo: s/Unale/Unable/

10 years agotests: thin external origin resize
Zdenek Kabelac [Thu, 23 Jan 2014 13:17:00 +0000 (14:17 +0100)]
tests: thin external origin resize

10 years agothin: fix feature compare function
Zdenek Kabelac [Thu, 23 Jan 2014 12:47:23 +0000 (13:47 +0100)]
thin: fix feature compare function

Comparing for available feature missed the code path, when
maj is already bigger.

The bug would be only hit in the case, thin pool target would have
increased major version.

10 years agothin: validate resize of thin LV with ext. origin
Zdenek Kabelac [Thu, 23 Jan 2014 12:10:29 +0000 (13:10 +0100)]
thin: validate resize of thin LV with ext. origin

When thin volume is using external origin, current thin target
is not able to supply 'extended' size with empty pages.

lvm2 detects version and disables extension of LV past the external
origin size in this case.

Thin LV could be however still reduced and extended freely bellow
this size.

10 years agothin: rename function
Zdenek Kabelac [Thu, 23 Jan 2014 10:47:10 +0000 (11:47 +0100)]
thin: rename function

Rename pool_can_resize_metadata() to more reusable
thin_pool_feature_supported() which could be queried
for mutiple different features.

10 years agomissed pool_manip.c
Zdenek Kabelac [Thu, 23 Jan 2014 08:56:17 +0000 (09:56 +0100)]
missed pool_manip.c

Seems like this file is missing from the thin_manip move.
Make the tree compilable again.

10 years agoMisc: Change name of lvcreate_params field - s/create_thin_pool/create_pool/
Jonathan Brassow [Wed, 22 Jan 2014 16:30:55 +0000 (10:30 -0600)]
Misc: Change name of lvcreate_params field - s/create_thin_pool/create_pool/

In preparation for other segment types that create and use "pools", we
s/create_thin_pool/create_pool/.  This way it is not awkward when creating
a cachepool, for example, to use "create_thin_pool".

10 years agoMisc: Move some thin pool functions to a new file
Jonathan Brassow [Wed, 22 Jan 2014 16:11:29 +0000 (10:11 -0600)]
Misc: Move some thin pool functions to a new file

Functions that handle set-up, tear-down and creation of thin pool
volumes will be more generally applicable when more targets exist
that make use of device-mapper's persistent data format.  One of
these targets is the dm-cache target.  I've selected some functions
that will be useful for the cache segment type to be moved, since
they will no longer be thin pool specific but are more broadly
useful to any segment type that makes use of a 'pool' LV.

10 years agowiping: issue error if libblkid detects signature and fails to return offset/length
Peter Rajnoha [Wed, 22 Jan 2014 15:26:49 +0000 (16:26 +0100)]
wiping: issue error if libblkid detects signature and fails to return offset/length

We need both offset and length when trying to wipe detected signatures.
The libblkid can fail so it's good to have an error message issued for
this state instead of being silent (libblkid does not issue any error
messages here). We just issued "stack" here before but that was not
quite useful if some error occurs...

10 years agocoverity: check return value of dev_close in dev_get_block_size()
Peter Rajnoha [Wed, 22 Jan 2014 15:20:09 +0000 (16:20 +0100)]
coverity: check return value of dev_close in dev_get_block_size()

10 years agoWHATS_NEW: be more specific about cryptsetup version that sets the udev flags
Peter Rajnoha [Wed, 22 Jan 2014 14:48:40 +0000 (15:48 +0100)]
WHATS_NEW: be more specific about cryptsetup version that sets the udev flags

10 years agoudev: drop cryptsetup specific rules from 10-dm.rules
Peter Rajnoha [Wed, 22 Jan 2014 14:15:02 +0000 (15:15 +0100)]
udev: drop cryptsetup specific rules from 10-dm.rules

These udev flags are set directly in cryptsetup for some
time now so there's no need to have it in our rules then.

See also:
https://code.google.com/p/cryptsetup/source/detail?spec=svn4f14b43a3d3e7310465005c401f37e19f8cb85e6&r=4f14b43a3d3e7310465005c401f37e19f8cb85e6

10 years agoautoconf: Update config.guess/sub to 2014-01-01.
Alasdair G Kergon [Tue, 21 Jan 2014 22:00:15 +0000 (22:00 +0000)]
autoconf: Update config.guess/sub to 2014-01-01.

10 years agotests: more testing for online thin metadata resize
Zdenek Kabelac [Tue, 21 Jan 2014 09:04:23 +0000 (10:04 +0100)]
tests: more testing for online thin metadata resize

Some more tests for online resize, but it's still disabled
by default, since kernel doesn't work yet for this feature.

10 years agothin: online metadata resize requires 1.10
Zdenek Kabelac [Tue, 21 Jan 2014 12:48:57 +0000 (13:48 +0100)]
thin: online metadata resize requires 1.10

Version 1.10 starts to look promissing, let's enable
online resize when this thin-pool kernel target is present.

10 years agopost-release
Alasdair G Kergon [Mon, 20 Jan 2014 19:41:30 +0000 (19:41 +0000)]
post-release

10 years agopre-release v2_02_105
Alasdair G Kergon [Mon, 20 Jan 2014 19:22:56 +0000 (19:22 +0000)]
pre-release

10 years agoudev: clear temporary variable properly
Peter Rajnoha [Mon, 20 Jan 2014 11:54:10 +0000 (12:54 +0100)]
udev: clear temporary variable properly

Clear temporary DM_DISABLE_OTHER_RULES_FLAG properly. This did not
cause any bug or problem as the temporary variable is overwritten next
time it's used again, but we should still clean it properly!

10 years agothin: fix thin LV flagging for udev to skip scanning
Peter Rajnoha [Mon, 20 Jan 2014 11:38:21 +0000 (12:38 +0100)]
thin: fix thin LV flagging for udev to skip scanning

Only flag thin LV for no scanning in udev if this LV is about
to be wiped. This happens only in case the thin LV's pool was not
created with zeroing of the new blocks enabled.

10 years agotests: update testing for xfs
Zdenek Kabelac [Mon, 20 Jan 2014 11:02:33 +0000 (12:02 +0100)]
tests: update testing for xfs

10 years agofsadm: use xfs_repair when available
Zdenek Kabelac [Mon, 20 Jan 2014 10:57:39 +0000 (11:57 +0100)]
fsadm: use xfs_repair when available

Since support for xfs_check is going to be obsoleted,
replace its usage with xfs_repair -n tool.

However this tool needs further intrumentation, since for really small
xfs devices (having just 1 allocation group) it needs to pass in
flag: "-o force_geometry". As we run the tool with '-n', it should
be safe to pass this flag always.

FIXME: figure way without always passing this flag.

10 years agolibdm: WHATSNEW
Zdenek Kabelac [Fri, 17 Jan 2014 10:02:29 +0000 (11:02 +0100)]
libdm: WHATSNEW

10 years agolibdm: preload revert after failing callback
Zdenek Kabelac [Wed, 15 Jan 2014 11:42:47 +0000 (12:42 +0100)]
libdm: preload revert after failing callback

Revert activated volumes if callback fails.
This is currently used only for thin_check failure support.

When thin_check detects failure in thin metadata device, it deactivate
volumes in reversed order that have been preloaded for thin pool activation.
After this change lvm command will not leave active pool subvolumes
in dm table.

10 years agocleanup: indent
Zdenek Kabelac [Wed, 8 Jan 2014 15:51:11 +0000 (16:51 +0100)]
cleanup: indent

10 years agopvresize: Fix orphan PV size calculation.
Alasdair G Kergon [Fri, 17 Jan 2014 01:12:04 +0000 (01:12 +0000)]
pvresize: Fix orphan PV size calculation.

The size of any metadata must be ignored when calculating the size of an
orphan PV.

Bug introduced by 603b45e0ed1032875f587eda3391c47b6652303c ("pvresize: Do
not use pv_read (get the PV from orphan VG).")

10 years agopvresize: Avoid archiving orphan VG metadata.
Alasdair G Kergon [Thu, 16 Jan 2014 23:02:59 +0000 (23:02 +0000)]
pvresize: Avoid archiving orphan VG metadata.

Block creations of archive and backup files for internal orphan VGs.

Bug introduced by 603b45e0ed1032875f587eda3391c47b6652303c ("pvresize: Do
not use pv_read (get the PV from orphan VG).")

10 years agoudev: do not drop SYSTEMD_READY for non-activating events
Peter Rajnoha [Tue, 14 Jan 2014 16:49:39 +0000 (17:49 +0100)]
udev: do not drop SYSTEMD_READY for non-activating events

Do not drop device's flag to report readiness for systemd
processing if there's any event that follows the activatiion
event itself. Otherwise, systemd would lost track of this device
on any other event that follows the activating event (IOW, we
need to make SYSTEMD_READY variable change level-based, not edge-based).

This patch applies for MD and loop devices used as PVs.

(intra-release fix for commit 4c267c7286145165dfe078f77d18d194a21a2e1c)

10 years agoformat1: Mark obsolete and do not use with lvmetad.
Alasdair G Kergon [Tue, 14 Jan 2014 03:27:45 +0000 (03:27 +0000)]
format1: Mark obsolete and do not use with lvmetad.

DO NOT USE LVMETAD IF YOU HAVE ANY LVM1-FORMATTED PVS.

You may continue to use it without lvmetad, but do please schedule
an upgrade to the lvm2 format (with 'vgconvert').

Sending the original LVM1 formatted metadata to lvmetad is breaking
assumptions made by the code, so I am marking the format as obsolete for
now and no longer sending it to lvmetad.

This means that if you are using lvmetad, lvm1 volumes will usually
appear invisible - though not always: it depends on exactly what
sequence of commands you run!

The current situation is not satisfactory.

We'll either fix lvmetad and reenable this or we'll fix the code to
issue appropriate warning messages when lvm1 PVs are encountered
to avoid accidents.

(The latest unfixed problem is that lvmetad assumes metadata sequence
numbers exist and always increase - but the lvm1 format does not define
or store any sequence number, confusing both the daemon and client
when default values get passed to-and-fro.)

10 years agopvs: fix segfaults with orphans
Alasdair G Kergon [Tue, 14 Jan 2014 03:17:27 +0000 (03:17 +0000)]
pvs: fix segfaults with orphans

Several fields used to display 0 if undefined.  Recent changes
to the way the fields are reported threw away some tests for
valid pointers, leading to segfaults with 'pvs -o all'.

Reinstate the original behaviour.

10 years agolvmcache: Invalidate cached VG if PV is orphaned.
Alasdair G Kergon [Tue, 14 Jan 2014 02:57:03 +0000 (02:57 +0000)]
lvmcache: Invalidate cached VG if PV is orphaned.

If a PV in an existing VG becomes orphaned (with 'pvcreate -ff', for
example) the VG struct cached against its vginfo must be invalidated.
This is because the struct device it references no longer contains
the PV label so becomes incorrect.

This triggers the error:
  Internal error: PV $dev unexpectedly not in cache.
when the PV from the cached VG metadata is subsequently looked up
in the cache.

Bug introduced in 2.02.87 by commit 7ad0d47c3c93053c07c45161dbdbc0798ac7e2f6
("Cache and share generated VG structs").

Before:

lvm> pvs
  PV         VG   Fmt  Attr PSize  PFree
  /dev/loop3 vg12 lvm2 a--  28.00m 28.00m
  /dev/loop4 vg12 lvm2 a--  28.00m 28.00m
lvm> pvcreate -ff /dev/loop3
Really INITIALIZE physical volume "/dev/loop3" of volume group "vg12" [y/n]? y
  WARNING: Forcing physical volume creation on /dev/loop3 of volume group "vg12"
  Physical volume "/dev/loop3" successfully created
lvm> pvs
  Internal error: PV /dev/loop3 unexpectedly not in cache.
  PV         VG   Fmt  Attr PSize  PFree
  /dev/loop3 vg12 lvm2 a--  28.00m 28.00m
  /dev/loop3      lvm2 a--  32.00m 32.00m
  /dev/loop4 vg12 lvm2 a--  28.00m 28.00m

After:
lvm> pvs
  PV         VG   Fmt  Attr PSize  PFree
  /dev/loop3 vg12 lvm2 a--  28.00m 28.00m
  /dev/loop4 vg12 lvm2 a--  28.00m 28.00m
lvm> pvcreate -ff /dev/loop3
Really INITIALIZE physical volume "/dev/loop3" of volume group "vg12" [y/n]? y
  WARNING: Forcing physical volume creation on /dev/loop3 of volume group "vg12"
  Physical volume "/dev/loop3" successfully created
lvm> pvs
  PV             VG   Fmt  Attr PSize  PFree
  /dev/loop3          lvm2 a--  32.00m 32.00m
  /dev/loop4     vg12 lvm2 a--  28.00m 28.00m
  unknown device vg12 lvm2 a-m  28.00m 28.00m

10 years agoreporter: Set labeller on dummy labels (fixes missing fmt field).
Petr Rockai [Mon, 13 Jan 2014 10:45:38 +0000 (11:45 +0100)]
reporter: Set labeller on dummy labels (fixes missing fmt field).

10 years agoreport: Do not try to get dev_size of a NULL device.
Petr Rockai [Mon, 13 Jan 2014 10:45:18 +0000 (11:45 +0100)]
report: Do not try to get dev_size of a NULL device.

10 years agotoollib: Fix a pool leak in _process_all_devs.
Petr Rockai [Mon, 13 Jan 2014 10:26:43 +0000 (11:26 +0100)]
toollib: Fix a pool leak in _process_all_devs.

10 years agotest: Increase the overall timeout to 3 hours.
Petr Rockai [Mon, 16 Dec 2013 16:35:33 +0000 (17:35 +0100)]
test: Increase the overall timeout to 3 hours.

10 years agotest: Time out the entire testsuite after an hour.
Petr Rockai [Mon, 16 Dec 2013 10:47:09 +0000 (11:47 +0100)]
test: Time out the entire testsuite after an hour.

10 years agotest: Use klogctl in the harness instead of reading /var/log/messages.
Petr Rockai [Sun, 15 Dec 2013 20:10:57 +0000 (21:10 +0100)]
test: Use klogctl in the harness instead of reading /var/log/messages.

10 years agotest: Add a regression test for pvcreate -ff.
Petr Rockai [Wed, 8 Jan 2014 14:23:30 +0000 (15:23 +0100)]
test: Add a regression test for pvcreate -ff.

10 years agolvmetad: Fix getting vgid_old & avoid removing in-transition VGs.
Petr Rockai [Wed, 8 Jan 2014 13:54:26 +0000 (14:54 +0100)]
lvmetad: Fix getting vgid_old & avoid removing in-transition VGs.

10 years agotests: use compiled lvm for clvmd executed lvs
Zdenek Kabelac [Wed, 8 Jan 2014 12:52:05 +0000 (13:52 +0100)]
tests: use compiled lvm for clvmd executed lvs

10 years agoliblvm: mark constant as unsigned
Zdenek Kabelac [Wed, 8 Jan 2014 11:04:41 +0000 (12:04 +0100)]
liblvm: mark constant as unsigned

10 years agolvmetad: add parentheses around assignment
Zdenek Kabelac [Wed, 8 Jan 2014 10:54:28 +0000 (11:54 +0100)]
lvmetad: add parentheses around assignment

10 years agolibdm: pass dnode to callback
Zdenek Kabelac [Wed, 8 Jan 2014 09:30:25 +0000 (10:30 +0100)]
libdm: pass dnode to callback

Pass dnode  pointer instead of rather unknown child pointer.
The pointer is currently unused and passing child pointer
is quite undefined, while dnode has at least some usability.

10 years agothin: accept const struct
Zdenek Kabelac [Wed, 8 Jan 2014 09:27:17 +0000 (10:27 +0100)]
thin: accept const struct

10 years agothin: cleanup _thin_pool_add_message
Peter Rajnoha [Wed, 8 Jan 2014 09:56:05 +0000 (10:56 +0100)]
thin: cleanup _thin_pool_add_message

Make this code a bit more readable for Coverity as otherwise
it marks the "type" variable in the "_thin_pool_add_message" fn
as undefined for certain path (...which is normally unreachable anyway,
but let's clean this up).

10 years agopvscan: use format feature flags in lvmetad code
Alasdair G Kergon [Wed, 8 Jan 2014 02:13:13 +0000 (02:13 +0000)]
pvscan: use format feature flags in lvmetad code

Introduce FMT_OBSOLETE to identify pool metadata and use it and FMT_MDAS
instead of hard-coded format names.
Explain device accesses on pvscan --cache man page.

10 years agolvmetad: free fid after vg lookup failure
Alasdair G Kergon [Wed, 8 Jan 2014 01:51:23 +0000 (01:51 +0000)]
lvmetad: free fid after vg lookup failure

10 years agoMisc: Get rid of some compiler warnings.
Jonathan Brassow [Wed, 8 Jan 2014 01:37:07 +0000 (19:37 -0600)]
Misc:  Get rid of some compiler warnings.

10 years agolvmetad: Flush a VG if it goes completely missing due to pv_found.
Petr Rockai [Tue, 7 Jan 2014 02:28:20 +0000 (03:28 +0100)]
lvmetad: Flush a VG if it goes completely missing due to pv_found.

10 years agolvmetad: Fix a corruption-prone race in error path.
Petr Rockai [Tue, 7 Jan 2014 02:04:14 +0000 (03:04 +0100)]
lvmetad: Fix a corruption-prone race in error path.

10 years agotoollib: Fix a mis-merge in _process_all_devs (duplicated pvs -a output).
Petr Rockai [Tue, 7 Jan 2014 01:49:12 +0000 (02:49 +0100)]
toollib: Fix a mis-merge in _process_all_devs (duplicated pvs -a output).

10 years agoliblvm: Save off and restore umask values
Tony Asleson [Tue, 17 Dec 2013 22:51:11 +0000 (16:51 -0600)]
liblvm: Save off and restore umask values

lvm has a default umask value in the config file that defaults
to 0077 which lvm changes to during normal operation.  This
causes a problem when the code is used as a library with
liblvm as it is changing the umask for the process.  This
patch saves off the current umask, sets to what is specified
in the config file and restores it what it was on library
function call exit.

The user is now free to change the umask in their application at
anytime including between library calls.

This fix address BZ:
https://bugzilla.redhat.com/show_bug.cgi?id=1012113

Tested by setting umask to 0777 and running the python unit
test and verifying that umask is still same value as expected
at the test completion and with a successful run.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
10 years agodevice: if BLKPBSZGET is unavailable, try to use BLKSSZGET with fallback to 512b
Peter Rajnoha [Wed, 18 Dec 2013 12:52:01 +0000 (13:52 +0100)]
device: if BLKPBSZGET is unavailable, try to use BLKSSZGET with fallback to 512b

10 years agosystemd: use only major:minor for pvscan in lvm2-pvscan@.service
Peter Rajnoha [Wed, 18 Dec 2013 11:00:02 +0000 (12:00 +0100)]
systemd: use only major:minor for pvscan in lvm2-pvscan@.service

When using filters for the pvscan --cache (the global_filter),
there's a difference between:

  pvscan --cache -aay /dev/block/<major>:<minor>

and

  pvscan --cache -aay <major>:<minor> (or --major <major> --minor <minor>)

In the first case, we need to be sure to have an exact matching line
in the filter for the device to be used, no aliases are considered
So for example even if we have accept rule for "/dev/sda" present,
this won't apply for "/dev/block/8:0" even though it's the same device!
This is because we're comparing the path used on command line directly
with the path written in the rule.

For the second one, any alias mentioned in the filter will apply
as we're comparing the major and minor pair, not looking at actual
device names - so any alias mentioned in the rules will suffice for
the filtering rule to apply.

For the global_filter to be properly used, we need to call the
second one in the lvm2-pvscan@.service - nobody is able to tell
what value of major:minor the kernel assignes next time, hence
this bug makes the use of global_filter quite unusable!

10 years agodevice: if BLKPBSZGET is unavailable, enforce 512
Zdenek Kabelac [Wed, 18 Dec 2013 09:52:09 +0000 (10:52 +0100)]
device: if BLKPBSZGET is unavailable, enforce 512

If there is no define for BLKPBSZGET - we have hard time how to
decrypt physical block size - we can't use here block_size,
since this is usually 4k while we need to use 512b.

FIXME: find some better way, until that enforce value 512.
Eventually we could also try to put in:

+#ifndef BLKPBSZGET
+# define BLKPBSZGET _IO(0x12,123)
+#endif

but this will still not work well on old kernels.

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