]> sourceware.org Git - lvm2.git/log
lvm2.git
10 years agothin: check for active lv
Zdenek Kabelac [Mon, 15 Sep 2014 11:42:43 +0000 (13:42 +0200)]
thin: check for active lv

Before calling deactivate, check the lv is actually active,
as we may reach this 'bad' error path with pool_lv inactive.

10 years agoWHATS_NEW for filter-related changes
Petr Rockai [Sat, 13 Sep 2014 15:34:13 +0000 (17:34 +0200)]
WHATS_NEW for filter-related changes

10 years agolibdm: finish the comment
Peter Rajnoha [Fri, 12 Sep 2014 13:35:57 +0000 (15:35 +0200)]
libdm: finish the comment

10 years agolibdm: fix dm_is_dm_major to not issue error about missing /proc lines for dm module.
Peter Rajnoha [Fri, 12 Sep 2014 13:17:57 +0000 (15:17 +0200)]
libdm: fix dm_is_dm_major to not issue error about missing /proc lines for dm module.

This is probably better approach than 3880ca5ecad1761bd13a190c58f8f85fdd7cd0e1.

If dm module is not loaded during dm_is_dm_major call, there are no
lines for dm in /proc/devices, of course. Normally, dm_is_dm_major
is called to check existing devices, hence if module is not loaded,
we can expect there's no DM device present at the same time so we
can directly return 0 here (meaning the major number being inspected
is not dm device's one).

See also https://bugzilla.redhat.com/show_bug.cgi?id=1059711.

10 years agorevert: commit 3880ca5ecad1761bd13a190c58f8f85fdd7cd0e1
Peter Rajnoha [Fri, 12 Sep 2014 13:16:08 +0000 (15:16 +0200)]
revert: commit 3880ca5ecad1761bd13a190c58f8f85fdd7cd0e1

There's a better solution to this...

10 years agocleanup: skip unused assign
Zdenek Kabelac [Fri, 12 Sep 2014 09:39:31 +0000 (11:39 +0200)]
cleanup: skip unused assign

Reset of tmp_names is only needed in else{} path.

10 years agocleanup: avoid strlen() we know max size
Zdenek Kabelac [Fri, 12 Sep 2014 09:35:51 +0000 (11:35 +0200)]
cleanup: avoid strlen() we know max size

Just use max NAME_LEN size buffer and copy the name.

10 years agocleanup: simplify _extract_image_components
Zdenek Kabelac [Thu, 11 Sep 2014 20:55:12 +0000 (22:55 +0200)]
cleanup: simplify _extract_image_components

Reorder test - first check for writable flag and then allocate.

10 years agocleanup: missing error message
Zdenek Kabelac [Thu, 11 Sep 2014 21:32:54 +0000 (23:32 +0200)]
cleanup: missing error message

10 years agocleanup: better error messages
Zdenek Kabelac [Thu, 11 Sep 2014 21:32:37 +0000 (23:32 +0200)]
cleanup: better error messages

10 years agoraid: destroy allocation handle on error path
Zdenek Kabelac [Fri, 12 Sep 2014 09:37:01 +0000 (11:37 +0200)]
raid: destroy allocation handle on error path

Don't leak ah memory pool on error path.

10 years agocleanup: update _alloc_image_component function
Zdenek Kabelac [Fri, 12 Sep 2014 09:48:41 +0000 (11:48 +0200)]
cleanup: update _alloc_image_component function

Return allocated volume directly instead of 1/0.

10 years agocleanup: plain code reindent
Zdenek Kabelac [Thu, 11 Sep 2014 18:08:56 +0000 (20:08 +0200)]
cleanup: plain code reindent

Just simple reindent and brace changes.

10 years agodebug: add missing stack trace on error path
Zdenek Kabelac [Thu, 11 Sep 2014 18:11:44 +0000 (20:11 +0200)]
debug: add missing stack trace on error path

10 years agoraid: use _generate_raid_name
Zdenek Kabelac [Fri, 12 Sep 2014 09:39:48 +0000 (11:39 +0200)]
raid: use _generate_raid_name

Use new function to get implicit name validation
(so we do not exit with internal error on metadata validation).

10 years agoraid: add function for name creation
Zdenek Kabelac [Fri, 12 Sep 2014 09:30:00 +0000 (11:30 +0200)]
raid: add function for name creation

Add name for construction and validation of raid subvolume
name with a given suffix.

TODO: check if reusable for mirrors as well.

10 years agoraid: check result of get_segtype_from_string
Zdenek Kabelac [Fri, 12 Sep 2014 09:48:51 +0000 (11:48 +0200)]
raid: check result of get_segtype_from_string

Error here is rather highly unpexpected for these types, but
stay consistent with rest of the code and don't use unchecked value.

10 years agoraid: add missing archive call
Zdenek Kabelac [Fri, 12 Sep 2014 09:30:38 +0000 (11:30 +0200)]
raid: add missing archive call

Before starting to update raid metadata, archive existing unmodified one.

10 years agoraid: add missing vg_revert
Zdenek Kabelac [Thu, 11 Sep 2014 17:58:28 +0000 (19:58 +0200)]
raid: add missing vg_revert

After failing vg_write() and suspend_lv() there was missing vg_revert() call.

10 years agoraid: add missing backups
Zdenek Kabelac [Thu, 11 Sep 2014 17:05:40 +0000 (19:05 +0200)]
raid: add missing backups

Add backup() calls that were missing after successful update
of metadata.

10 years agoallocation: use vg memory pool
Zdenek Kabelac [Thu, 11 Sep 2014 17:00:13 +0000 (19:00 +0200)]
allocation: use vg memory pool

Looks like forgotten memory allocation related to VG used cmd mem pool.

10 years agolibdm: use dm-mod autoloading during dm_is_dm_major call if needed
Peter Rajnoha [Fri, 12 Sep 2014 10:49:37 +0000 (12:49 +0200)]
libdm: use dm-mod autoloading during dm_is_dm_major call if needed

For dm_is_dm_major to determine whether the major number given as
an argument belongs to a DM device, libdm code needs to know what
the actual DM major is to do the comparison.

It may happen that the dm-mod module is not loaded during this
call and so for the completness let's try our best before we start
giving various errors - we can still make use of dm-mod autoloading,
though only since kernels 2.6.36 where this feature was introduced.

10 years agoconf: add allocation/physical_extent_size config option for default PE size of VGs.
Peter Rajnoha [Fri, 12 Sep 2014 08:03:12 +0000 (10:03 +0200)]
conf: add allocation/physical_extent_size config option for default PE size of VGs.

Removes a need to use "vgcreate -s <desired PE size>" all the
time time just to override hardcoded default which is 4096KiB.

10 years agofilters: fix incorrect filter indexing in composite filter array
Peter Rajnoha [Thu, 11 Sep 2014 07:30:03 +0000 (09:30 +0200)]
filters: fix incorrect filter indexing in composite filter array

Caused by recent changes - a7be3b12dfe7388d1648595e6cc4c7a1379bb8a7.
If global filter was not defined, then part of the code
creating composite filter (the cmd->lvmetad_filter) incorrectly
increased index value even if this global filter was not created
as part of the composite filter. This caused a gap with "NULL"
value in the composite filter array which ended up with the rest
of the filters after the gap to be ignored and also it caused a mem
leak when destroying the composite filter.

10 years agotests: test for rename of snapshot
Zdenek Kabelac [Wed, 10 Sep 2014 20:02:18 +0000 (22:02 +0200)]
tests: test for rename of snapshot

10 years agolvmetad: Differentiate between filtered and truly missing devices.
Petr Rockai [Wed, 10 Sep 2014 10:45:52 +0000 (12:45 +0200)]
lvmetad: Differentiate between filtered and truly missing devices.

We used to print an error message whenever we tried to deal with devices that
lvmetad knew about but were rejected by a client-side filter. Instead, we now
check whether the device is actually absent or only filtered out and only print
a warning in the latter case.

10 years agotest: Add a test for MD component detection in pvscan --cache.
Petr Rockai [Tue, 9 Sep 2014 15:25:29 +0000 (17:25 +0200)]
test: Add a test for MD component detection in pvscan --cache.

10 years agolvmetad: Re-organise filters to properly avoid scans of component devices.
Petr Rockai [Tue, 9 Sep 2014 15:16:40 +0000 (17:16 +0200)]
lvmetad: Re-organise filters to properly avoid scans of component devices.

If a PV label is exposed both through a composite device (MD for example) and
through its component devices, we always want the PV that lvmetad sees to be the
composite, since this is what all LVM commands (including activation) will then
use. If pvscan --cache is triggered for multiple clones of the same PV, the last
to finish wins. This patch basically re-arranges the filters so that
component-device filters are part of the global_filter chain, not of the
client-side filter chain. This has a subtle effect on filter evaluation order,
but should not alter visible semantics in the non-lvmetad case.

10 years agodev-cache: Filter wipe does not guarantee a full /dev scan.
Petr Rockai [Tue, 9 Sep 2014 15:14:35 +0000 (17:14 +0200)]
dev-cache: Filter wipe does not guarantee a full /dev scan.

The code in dev_iter_create assumes that if a filter can be wiped, doing so will
always trigger a call to _full_scan. This is not true for composite filters
though, since they can always be wiped in principle, but there is no way to know
that a component filter inside will exist that actually triggers the scan.

10 years agodebug: turn message into debug
Zdenek Kabelac [Wed, 10 Sep 2014 08:10:13 +0000 (10:10 +0200)]
debug: turn message into debug

This message should be printed only for activation commands,
however since the handling of this flag is not correct
(rhbz 1140029) and will require further changes,
do now just a minor change and switch message into log_debug
(so it's not printed i.e. with every  'lvs -v')

10 years agotests: test for rename of snapshot
Zdenek Kabelac [Tue, 9 Sep 2014 18:17:47 +0000 (20:17 +0200)]
tests: test for rename of snapshot

10 years agolv_rename: actual fix for snapshot
Zdenek Kabelac [Tue, 9 Sep 2014 18:15:51 +0000 (20:15 +0200)]
lv_rename: actual fix for snapshot

By my rebasing mistake it's been eliminated from previous patch set.

10 years agolv_update_and_reload: replace code sequence
Zdenek Kabelac [Tue, 9 Sep 2014 12:40:32 +0000 (14:40 +0200)]
lv_update_and_reload: replace code sequence

Use lv_update_and_reload() and lv_update_and_reload_origin()
to handle write/suspend/commit/resume sequence.

In few places this properly handle vg_revert() after suspend failure,
and also ensures there is metadata backup after successful vg_commit().

10 years agolvconvert: use lv_update_and_reload
Zdenek Kabelac [Mon, 8 Sep 2014 20:48:42 +0000 (22:48 +0200)]
lvconvert: use lv_update_and_reload

Use lib function.

10 years agolv_manip: remove vg_revert
Zdenek Kabelac [Mon, 8 Sep 2014 20:39:58 +0000 (22:39 +0200)]
lv_manip: remove vg_revert

vg_commit is supposed to have implicit revert handling.
(however as of now it needs fixes).

10 years agolv_rename: fix snapshot rename
Zdenek Kabelac [Tue, 9 Sep 2014 16:47:27 +0000 (18:47 +0200)]
lv_rename: fix snapshot rename

Fix rename operation for snapshot (cow) LV.
Only the snapshot's origin has the lock and by mistake suspend
and resume has been called for the snapshot LV.
This further made volumes unusable in cluster.

So instead of suspend and resuming list of LVs,
we need to just suspend and resume origin.

As the sequence write/suspend/commit/resume
is widely used in lvm2 code base - move it to
new lv_update_and_reload function.

10 years agocleanup: add stacktrace for error path
Zdenek Kabelac [Mon, 8 Sep 2014 20:36:42 +0000 (22:36 +0200)]
cleanup: add stacktrace for error path

10 years agoso: make sure shared libs are built with RELRO option
Peter Rajnoha [Thu, 4 Sep 2014 08:52:41 +0000 (10:52 +0200)]
so: make sure shared libs are built with RELRO option

In addition to using RELRO for daemons, use this option for shared
libraries. See also commit a65ab773b4ddb06e87d678d3b2f4d0ca3e5b9fd0.

10 years agopost-release
Alasdair G Kergon [Mon, 1 Sep 2014 00:53:44 +0000 (01:53 +0100)]
post-release

10 years agopre-release v2_02_111
Alasdair G Kergon [Mon, 1 Sep 2014 00:51:47 +0000 (01:51 +0100)]
pre-release

10 years agocleanup: drop extra ()
Zdenek Kabelac [Fri, 29 Aug 2014 09:58:16 +0000 (11:58 +0200)]
cleanup: drop extra ()

Pure  '==' test doesn't need extra ().

10 years agocleanup: drop duplicate const
Zdenek Kabelac [Fri, 29 Aug 2014 09:51:53 +0000 (11:51 +0200)]
cleanup: drop duplicate const

No need to specify 'const' twice in these cases.

10 years agocleanup: assignment into ()
Zdenek Kabelac [Thu, 28 Aug 2014 11:53:36 +0000 (13:53 +0200)]
cleanup: assignment into ()

Put is_float=1 into () - so the intention is obvious.
Remove uneeded extra check for for  *s != 0,
since it's already checked for either digit or '.'.

10 years agomakefiles: include path missing
Zdenek Kabelac [Fri, 29 Aug 2014 10:51:28 +0000 (12:51 +0200)]
makefiles: include path missing

For deps calcs path for blkid.h needs to be known.

10 years agoWHATS_NEW
Zdenek Kabelac [Fri, 29 Aug 2014 11:00:16 +0000 (13:00 +0200)]
WHATS_NEW

10 years agoclvmd: use correctly sized buffers for sscanf
Zdenek Kabelac [Fri, 29 Aug 2014 10:00:05 +0000 (12:00 +0200)]
clvmd: use correctly sized buffers for sscanf

sscanf needs extra 1 char for '\0'

10 years agoWHATS_NEW_DM
Zdenek Kabelac [Fri, 29 Aug 2014 10:57:30 +0000 (12:57 +0200)]
WHATS_NEW_DM

10 years agolibdm: revert incorrect path length size for sscanf
Zdenek Kabelac [Fri, 29 Aug 2014 09:52:45 +0000 (11:52 +0200)]
libdm: revert incorrect path length size for sscanf

Commit 94786a3bbf0b68883a2618c9bc25fc88e367f9f8 introduced
another bug - since sscanf needs extra 1 byte for \0.

Since there is no easy way to do a macro evaluation for (PATH_MAX-1)
and string concatation of this number to get resulting (%4095s) - let's
go with easiest path and restore extra byte for 0.

Other option would be to prepare sscanf parsing string in runtime.

But lets resolve it when we look at PATH_MAX handling later...

10 years agolvextend: Reinstate --nosync logic for mirrors.
Alasdair G Kergon [Wed, 27 Aug 2014 23:40:09 +0000 (00:40 +0100)]
lvextend: Reinstate --nosync logic for mirrors.

Reinstate the logic for syncing extensions of mirrors created with
--nosync.  (Inadvertently disabled by the approximate allocation
changes.)

10 years agoWHATS_NEW
Zdenek Kabelac [Wed, 27 Aug 2014 14:52:32 +0000 (16:52 +0200)]
WHATS_NEW

10 years agocache: fix allocation size
Zdenek Kabelac [Wed, 27 Aug 2014 14:45:39 +0000 (16:45 +0200)]
cache: fix allocation size

Commit 0b3d0e79f694ac9dc5a29270b2f791a250980058 caused regression
in allocation of cache pool. This patch is restoring corect size
for allocation.

10 years agocache: Clean-up error message.
Jonathan Brassow [Mon, 25 Aug 2014 00:44:37 +0000 (19:44 -0500)]
cache: Clean-up error message.

It is not an internal error message to report to the user that they
cannot create a cache LV on top of a cache LV.  It is simply not
supported yet.

10 years agopost-release
Alasdair G Kergon [Tue, 26 Aug 2014 15:41:18 +0000 (16:41 +0100)]
post-release

10 years agopre-release v2_02_110
Alasdair G Kergon [Tue, 26 Aug 2014 15:34:14 +0000 (16:34 +0100)]
pre-release

10 years agorevert: commit 8d00499167f010b82ea6ddebcc6b22ec170002f9
Peter Rajnoha [Tue, 26 Aug 2014 15:07:37 +0000 (17:07 +0200)]
revert: commit 8d00499167f010b82ea6ddebcc6b22ec170002f9

Let's test this more...

10 years agotests: thin and volume_list testing
Zdenek Kabelac [Tue, 26 Aug 2014 10:26:17 +0000 (12:26 +0200)]
tests: thin and volume_list testing

10 years agotests: fix volume list test
Zdenek Kabelac [Tue, 26 Aug 2014 10:09:03 +0000 (12:09 +0200)]
tests: fix volume list test

Proper use of \" escaping and shell vars.

10 years agocleanup: indent and stacktrack
Zdenek Kabelac [Tue, 26 Aug 2014 09:39:51 +0000 (11:39 +0200)]
cleanup: indent and stacktrack

Add missing stacktrace on error path
and newline indent.

10 years agocleanup: check pv_count is not 0
Zdenek Kabelac [Thu, 21 Aug 2014 13:38:18 +0000 (15:38 +0200)]
cleanup: check pv_count is not 0

Since we already detect writemostly_ARG is non-zero
make it obvious pv_count will also be non-zero in this case.

10 years agocleanup: use unsigned 1bit elements
Zdenek Kabelac [Thu, 21 Aug 2014 13:37:39 +0000 (15:37 +0200)]
cleanup: use unsigned 1bit elements

Avoid using signed 'int' type for 1 bit size.

10 years agocleanup: never return uninitialized buffer
Zdenek Kabelac [Thu, 21 Aug 2014 13:35:29 +0000 (15:35 +0200)]
cleanup: never return uninitialized buffer

Coverity noticed this function may return untouched buffer,
however in this state can't really happen, but anyway
ensure on error path the buffer will have zero lenght string.

10 years agolibdm: add check transaction_id after message
Zdenek Kabelac [Thu, 21 Aug 2014 13:39:27 +0000 (15:39 +0200)]
libdm: add check transaction_id after message

Add extra safety detection for thin pool transaction id
and query pool status after confirmed message.

In case there is a missmatch, immeditelly abort further
processing.

10 years agothin: fix volume_list support
Zdenek Kabelac [Tue, 26 Aug 2014 10:10:29 +0000 (12:10 +0200)]
thin: fix volume_list support

Fixing problem, when user sets volume_list and excludes thin pools
from activation. In this case pool return 'success' for skipped activation.

We need to really check the volume it is actually active to properly
to remove queued pool messages. Otherwise the lvm2 and kernel
metadata started to go async since lvm2 believed, messages were submitted.

Add also better check for threshold when create a new thin volume.
In this case we require local activation of thin pool so we are able
to check pool fullness.

10 years agothin: more forced ignoring of pool failure
Zdenek Kabelac [Tue, 26 Aug 2014 09:53:56 +0000 (11:53 +0200)]
thin: more forced ignoring of pool failure

Support also 'vgremove -ff' to properly remove even inactive/broken thin pools.
Update messages to use 'print_unless_silent' for the forced case.

10 years agocleanup: consolidate lv_layout and lv_role reporting
Peter Rajnoha [Mon, 25 Aug 2014 08:02:32 +0000 (10:02 +0200)]
cleanup: consolidate lv_layout and lv_role reporting

This patch makes the keyword combinations found in "lv_layout" and
"lv_role" much more understandable - there were some ambiguities
for some of the combinations which lead to confusion before.

Now, the scheme used is:

LAYOUTS ("how the LV is laid out"):
===================================
[linear] (all segments have number of stripes = 1)

[striped] (all segments have number of stripes > 1)

[linear,striped] (mixed linear and striped)

raid (raid layout always reported together with raid level, raid layout == image + metadata LVs underneath that make up raid LV)
  [raid,raid1]
  [raid,raid10]
  [raid,raid4]
  [raid,raid5] (exact sublayout not specified during creation - default one used - raid5_ls)
    [raid,raid5,raid5_ls]
    [raid,raid5,raid6_rs]
    [raid,raid5,raid5_la]
    [raid,raid5,raid5_ra]
  [raid6,raid] (exact sublayout not specified during creation - default one used - raid6_zr)
    [raid,raid6,raid6_zr]
    [raid,raid6,raid6_nc]
    [raid,raid6,raid6_ns]

[mirror] (mirror layout == log + image LVs underneath that make up mirror LV)

thin (thin layout always reported together with sublayout)
  [thin,sparse] (thin layout == allocated out of thin pool)
  [thin,pool] (thin pool layout == data + metadata volumes underneath that make up thin pool LV, not supposed to be used for direct use!!!)

[cache] (cache layout == allocated out of cache pool in conjunction with cache origin)
  [cache,pool] (cache pool layout == data + metadata volumes underneath that make up cache pool LV, not supposed to be used for direct use!!!)

[virtual] (virtual layout == not hitting disk underneath, currently this layout denotes only 'zero' device used for origin,thickorigin role)

[unknown] (either error state or missing recognition for such layout)

ROLES ("what's the purpose or use of the LV - what is its role"):
=================================================================
- each LV has either of these two roles at least:  [public] (public LV that users may use freely to write their data to)

  [public] (public LV that users may use freely to write their data to)
  [private] (private LV that LVM maintains; not supposed to be directly used by user to write his data to)

- and then some special-purpose roles in addition to that:

  [origin,thickorigin] (origin for thick-style snapshot; "thick" as opposed to "thin")
  [origin,multithickorigin] (there are more than 2 thick-style snapshots for this origin)
  [origin,thinorigin] (origin for thin snapshot)
  [origin,multithinorigin] (there are more than 2 thin snapshots for this origin)
  [origin,extorigin] (external origin for thin snapshot)
  [origin,multiextoriginl (there are more than 2 thin snapshots using this external origin)
  [origin,cacheorigin] (cache origin)

  [snapshot,thicksnapshot] (thick-style snapshot; "thick" as opposed to "thin")
  [snapshot,thinsnapshot] (thin-style snapshot)

  [raid,metadata] (raid metadata LV)
  [raid,image] (raid image LV)

  [mirror,image] (mirror image LV)
  [mirror,log] (mirror log LV)
  [pvmove] (pvmove LV)

  [thin,pool,data] (thin pool data LV)
  [thin,pool,metadata] (thin pool metadata LV)

  [cache,pool,data] (cache pool data LV)
  [cache,pool,metadata] (cache pool metadata LV)

  [pool,spare] (pool spare LV - common role of LV that makes it used for both thin and cache repairs)

10 years agoreport: use dm_report_field_string_list_unordered for reporting lv_layout and lv_role...
Peter Rajnoha [Mon, 25 Aug 2014 08:05:27 +0000 (10:05 +0200)]
report: use dm_report_field_string_list_unordered for reporting lv_layout and lv_role fields

This makes it a bit more readable since we can report more general
layouts/roles first and keywords describing the LV more precisely
afterwards in the list.

10 years agoreport: add dm_report_field_string_list_unsorted
Peter Rajnoha [Mon, 25 Aug 2014 08:04:08 +0000 (10:04 +0200)]
report: add dm_report_field_string_list_unsorted

10 years agorefactor: rename 'lv_type' field to 'lv_role'
Peter Rajnoha [Mon, 25 Aug 2014 07:07:03 +0000 (09:07 +0200)]
refactor: rename 'lv_type' field to 'lv_role'

The 'lv_type' field name was a bit misleading. Better one is 'lv_role'
since this fields describes what's the actual use of the LV currently -
its 'role'.

10 years agoautoreconf
Alasdair G Kergon [Fri, 22 Aug 2014 22:47:44 +0000 (23:47 +0100)]
autoreconf

10 years agoconfigure: Fix shared lvm1 typo.
Alasdair G Kergon [Fri, 22 Aug 2014 22:42:55 +0000 (23:42 +0100)]
configure: Fix shared lvm1 typo.

via https://bugs.gentoo.org/520640

10 years agolvcreate: disallow snapshot of cache lv
David Teigland [Fri, 22 Aug 2014 16:32:36 +0000 (11:32 -0500)]
lvcreate: disallow snapshot of cache lv

10 years agolvresize: Fix raid/mirror and %PE handling code.
Alasdair G Kergon [Fri, 22 Aug 2014 00:26:14 +0000 (01:26 +0100)]
lvresize: Fix raid/mirror and %PE handling code.

Sort out the lvresize calculation code to handle size changes
specified as physical extents as well as logical extents
and to process mirror resizing and raid extensions correctly.

The 'approx alloc' option was masking the underlying problem.

10 years agoman: dmsetup: -n is shortcut for --notable, not --noheadings
Peter Rajnoha [Thu, 21 Aug 2014 08:26:16 +0000 (10:26 +0200)]
man: dmsetup: -n is shortcut for --notable, not --noheadings

The -n was defined for --notable since beginning, but the man page
got wrong at some time...

10 years agotests: proper /dev access
Zdenek Kabelac [Wed, 20 Aug 2014 12:35:57 +0000 (14:35 +0200)]
tests: proper /dev access

Commit 5ebff6cc9f631b7409d99b72fa0b39ccec30bf1f seemed to introduce
new 'for' loop but the mode is not yet used.
But the access to /dev dir needs to go through $DM_DEV_DIR
and whole path needs to be in "".

10 years agolvconvert: snapshot: allow using raid1 for snapshot and snapshot origin
Peter Rajnoha [Wed, 20 Aug 2014 08:05:51 +0000 (10:05 +0200)]
lvconvert: snapshot: allow using raid1 for snapshot and snapshot origin

When testing conversion sanity, we checked lv->status & MIRRORED
which encompasses both old mirrors and raid1 mirrors. But we need to
ban only the old mirrors here hence allow raid1 mirrors.

10 years agocleanup: Remove extra ';' from the end of a line.
Jonathan Brassow [Tue, 19 Aug 2014 14:57:30 +0000 (09:57 -0500)]
cleanup: Remove extra ';' from the end of a line.

10 years agocleanup: simplier struct init
Zdenek Kabelac [Tue, 19 Aug 2014 12:30:52 +0000 (14:30 +0200)]
cleanup: simplier struct init

Use simplier struct initilizer.

10 years agocleanup: avoid double assign
Zdenek Kabelac [Tue, 19 Aug 2014 12:19:11 +0000 (14:19 +0200)]
cleanup: avoid double assign

Skip setting a value to a variable which is never
used and overwritten/set afterwards.

10 years agocleanup: use just PATH_MAX size
Zdenek Kabelac [Tue, 19 Aug 2014 09:35:18 +0000 (11:35 +0200)]
cleanup: use just PATH_MAX size

Avoid playing with +1.

PATH_MAX code needs probably more thinking anyway, since
there is no MAX path in Linux - user may easily create path
with 64kB chars - so 4kB buffer is surelly not enough for
such dirs.

Note:
http://insanecoding.blogspot.cz/2007/11/pathmax-simply-isnt.html

10 years agocleanup: use _ prefix for static functions
Zdenek Kabelac [Mon, 18 Aug 2014 15:34:01 +0000 (17:34 +0200)]
cleanup: use _ prefix for static functions

10 years agocleanup: reindent and make obvious error path
Zdenek Kabelac [Mon, 18 Aug 2014 20:04:39 +0000 (22:04 +0200)]
cleanup: reindent and make obvious error path

10 years agolibdm: check version prints error
Zdenek Kabelac [Tue, 19 Aug 2014 12:22:22 +0000 (14:22 +0200)]
libdm: check version prints error

Move 'bad' label above log_error, so the
error message is printed on 'bad' path.
(And return 0 is not without log_error()).

10 years agolv_manip: check for str_list_dup failure
Zdenek Kabelac [Tue, 19 Aug 2014 12:27:03 +0000 (14:27 +0200)]
lv_manip: check for str_list_dup failure

10 years agolvscan: check result of id_write_format
Zdenek Kabelac [Tue, 19 Aug 2014 12:26:06 +0000 (14:26 +0200)]
lvscan: check result of id_write_format

Currently rather impossible to happen - but check
for returned value of id_write_format().

10 years agometadata: check result of refresh and rescan
Zdenek Kabelac [Tue, 19 Aug 2014 12:25:02 +0000 (14:25 +0200)]
metadata: check result of refresh and rescan

Detect failure in case refresh_filters of lvmcache_label_scan fails.

10 years agodmeventd: fix test for select return value
Zdenek Kabelac [Tue, 19 Aug 2014 12:20:22 +0000 (14:20 +0200)]
dmeventd: fix test for select return value

Do not call read when select return -1 && EINTR.
Also check for return valuer from read() and
abort write function when unexpected error happens.

10 years agolv: remove lv_type_name fn
Peter Rajnoha [Tue, 19 Aug 2014 12:16:39 +0000 (14:16 +0200)]
lv: remove lv_type_name fn

The lv_type_name function is remnant from old code that reported
only single string for the LV type. LV types are now reported
in a more extended way as keyword list that describe the type
precisely (using lv_layout_and_type fn).

The lv_type_name was used in some error messages to display the
type of the LV so just reinstate the old messages back referencing
the type directly with a string - this is enough for error messages.
They don't need to display the LV type as precisely as it's used
on lvs output (which is optimized for selection anyway).

10 years agoreport: also display "mirror" keyword in lv_layout for mirrored mirror log and "cache...
Peter Rajnoha [Tue, 19 Aug 2014 11:58:32 +0000 (13:58 +0200)]
report: also display "mirror" keyword in lv_layout for mirrored mirror log and "cache" keyword in lv_layout for cached cache pool

$ lvs -a -o name,vg_name,attr,layout,type
  LV                    VG     Attr       Layout     Type
  lvol0                 vg     mwi-a-m--- mirror     mirror
  [lvol0_mimage_0]      vg     iwi-aom--- linear     image,mirror
  [lvol0_mimage_1]      vg     iwi-aom--- linear     image,mirror
  [lvol0_mlog]          vg     mwi-aom--- mirror     log,mirror
  [lvol0_mlog_mimage_0] vg     iwi-aom--- linear     image,mirror
  [lvol0_mlog_mimage_1] vg     iwi-aom--- linear     image,mirror

(lvol0_mlog properly displayed as "mirror" layout for mirrored mirror log)

$ lvs -a -o name,vg_name,attr,layout,type
  LV                  VG     Attr       Layout     Type
  lvol0               vg     Cwi---C--- cache,pool cache,pool
  [lvol0_cdata]       vg     Cwi------- linear     cache,data,pool
  [lvol0_cmeta]       vg     ewi------- linear     cache,metadata,pool
  [lvol1_pmspare]     vg     ewi------- linear     metadata,pool,spare
  lvol2               vg     Cwi---C--- cache,pool cache,pool
  [lvol2_cdata]       vg     Cwi---C--- cache      cache,data,pool
  [lvol2_cdata_corig] vg     owi---C--- linear     cache,origin
  [lvol2_cmeta]       vg     ewi------- linear     cache,metadata,pool

(lvol2_cdata properly displayed as cached cache pool data)

10 years agoreport: also display "mirror" keyword in lv_type for pvmove LV and display "multiple...
Peter Rajnoha [Tue, 19 Aug 2014 07:41:41 +0000 (09:41 +0200)]
report: also display "mirror" keyword in lv_type for pvmove LV and display "multiple" for external origin used for more than one thin snapshot

$ lvs -a -o name,vg_name,attr,layout,type
  LV        VG     Attr       Layout     Type
  lvol0     vg     -wI-a----- linear     linear
  [pvmove0] vg     p-C-aom--- mirror     mirror,pvmove

(added "mirror" for pvmove LV)

$ lvs -a -o name,vg_name,attr,layout,type
  LV              VG     Attr       Layout     Type
  lvol0           vg     ori------- linear     external,multiple,origin,thin
  [lvol1_pmspare] vg     ewi------- linear     metadata,pool,spare
  lvol2           vg     Vwi-a-tz-- thin       snapshot,thin
  lvol3           vg     Vwi-a-tz-- thin       snapshot,thin
  pool            vg     twi-a-tz-- pool,thin  pool,thin
  [pool_tdata]    vg     Twi-ao---- linear     data,pool,thin
  [pool_tmeta]    vg     ewi-ao---- linear     metadata,pool,thin

(added "multiple" for external origin used for more than one
thin snapshot - lvol0 in the example above)

10 years agoreport: fix thin external snapshot identification for lv_layout and lv_type fields
Peter Rajnoha [Mon, 18 Aug 2014 13:58:48 +0000 (15:58 +0200)]
report: fix thin external snapshot identification for lv_layout and lv_type fields

Thin snapshots having external origins missed the "snapshot" keyword for
lv_type field. Also, thin external origins which are thin devices (from
another pool) were not recognized properly.

For example, external origin itself can be either non-thin volume (lvol0
below) or it can be a thin volume from another pool (lvol3 below):

Before this patch:

$ lvs -o name,vg_name,attr,pool_lv,origin,layout,type
  Internal error: Failed to properly detect layout and type for for LV vg/lvol3
  Internal error: Failed to properly detect layout and type for for LV vg/lvol3
  LV    VG     Attr       Pool  Origin Layout     Type
  lvol0 vg     ori-------              linear     external,origin,thin
  lvol2 vg     Vwi-a-tz-- pool  lvol0  thin       thin
  lvol3 vg     ori---tz-- pool         unknown    external,origin,thin,thin
  lvol4 vg     Vwi-a-tz-- pool1 lvol3  thin       thin
  pool  vg     twi-a-tz--              pool,thin  pool,thin
  pool1 vg     twi-a-tz--              pool,thin  pool,thin

- lvol2 as well as lvol4 have missing "snapshot" in type field
- lvol3 has unrecognized layout (should be "thin"), but has double
  "thin" in lv_type which is incorrect
- (also there's double "for" in the internal error message)

With this patch applied:

$ lvs -o name,vg_name,attr,pool_lv,origin,layout,type
  LV    VG     Attr       Pool  Origin Layout     Type
  lvol0 vg     ori-------              linear     external,origin,thin
  lvol2 vg     Vwi-a-tz-- pool  lvol0  thin       snapshot,thin
  lvol3 vg     ori---tz-- pool         thin       external,origin,thin
  lvol4 vg     Vwi-a-tz-- pool1 lvol3  thin       snapshot,thin
  pool  vg     twi-a-tz--              pool,thin  pool,thin
  pool1 vg     twi-a-tz--              pool,thin  pool,thin

10 years agoRAID: Fail RAID4/5/6 creation if PE size is less than STRIPE_SIZE_MIN
Jonathan Brassow [Sat, 16 Aug 2014 02:15:34 +0000 (21:15 -0500)]
RAID: Fail RAID4/5/6 creation if PE size is less than STRIPE_SIZE_MIN

The maximum stripe size is equal to the volume group PE size.  If that
size falls below the STRIPE_SIZE_MIN, the creation of RAID 4/5/6 volumes
becomes impossible.  (The kernel will fail to load a RAID 4/5/6 mapping
table with a stripe size less than STRIPE_SIZE_MIN.)  So, we report an
error if it is attempted.

This is very rare because reducing the PE size down that far limits the
size of the PV below that of modern devices.

10 years agodmsetup: Support remove --deferred.
Alasdair G Kergon [Fri, 15 Aug 2014 23:34:48 +0000 (00:34 +0100)]
dmsetup: Support remove --deferred.

This patch adds a new flag --deferred to dmsetup remove. If this flag is
specified and the device is open, it is scheduled to be deleted on
close.

struct dm_info is extended.

The existing dm_task_get_info() is converted into a wrapper around the
new version dm_task_get_info_with_deferred_remove() so existing binaries
can still use the old smaller structure.

Recompiled code will pick up the new larger structure.

From: Mikulas Patocka <mpatocka@redhat.com>

10 years agocleanup: use display_lvname
Zdenek Kabelac [Fri, 15 Aug 2014 13:52:01 +0000 (15:52 +0200)]
cleanup: use display_lvname

Show more complete LV names.

10 years agocleanup: gcc warn fix
Zdenek Kabelac [Fri, 15 Aug 2014 13:51:03 +0000 (15:51 +0200)]
cleanup: gcc warn fix

Since gcc fail to see the origin has been already set under condition
above, just set origin again.

10 years agocleanup: gcc warning
Peter Rajnoha [Fri, 15 Aug 2014 13:43:42 +0000 (15:43 +0200)]
cleanup: gcc warning

One more:

metadata/thin_manip.c:503: warning: declaration of "snapshot_count" shadows a global declaration

10 years agocleanup: gcc warning
Peter Rajnoha [Fri, 15 Aug 2014 13:32:04 +0000 (15:32 +0200)]
cleanup: gcc warning

metadata/lv_manip.c:269: warning: declaration of "snapshot_count" shadows a global declaration

There's existing function called "snapshot_count" so rename the
variable to "snap_count".

10 years agoman: missing (C)ache in target type lv_attr description
Peter Rajnoha [Fri, 15 Aug 2014 13:21:15 +0000 (15:21 +0200)]
man: missing (C)ache in target type lv_attr description

10 years agocleanup: quite gcc warn
Zdenek Kabelac [Fri, 15 Aug 2014 12:08:06 +0000 (14:08 +0200)]
cleanup: quite gcc warn

gcc can't see dev_get_primary_dev  returns only 0,1,2
so ensure 'name' is always defined in valid path.

10 years agocleanup: drop extra braces
Zdenek Kabelac [Fri, 15 Aug 2014 11:52:21 +0000 (13:52 +0200)]
cleanup: drop extra braces

10 years agocleanup: just easier word wrapping
Zdenek Kabelac [Thu, 14 Aug 2014 09:11:14 +0000 (11:11 +0200)]
cleanup: just easier word wrapping

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