1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
Commit Graph

8064 Commits

Author SHA1 Message Date
Zdenek Kabelac
da5284a500 thin: lvconvert cannot convert pool to mirror
Suggest to use _tdata and _tmeta devices for that.
This fixes regression from too relaxed change in
f1d5f6ae81

Without this patch there are some empty LVs created before
mirror code recognizes it cannot continue.

(in release fix)
2013-07-24 17:17:19 +02:00
Zdenek Kabelac
7dc21c1597 python: make clean removes build dir
Cleanning compiled objects for clean: target.
2013-07-24 17:14:10 +02:00
Peter Rajnoha
a03609dee4 systemd: udevadm settle for lvm2-activation-net.service
In case lvmetad is not used, we need to wait for udev to complete
after net-attached storage is initialized (after iscsi/fcoe service).
N.B. This also requires the storage to be attached synchronously
in the kernel itself.
2013-07-24 11:06:38 +02:00
Alasdair G Kergon
cf09cf0cd3 Revert "lvm2app: lvm_vg_list_lvs filter hidden LVs"
This reverts commit a2b5147600.

The function has behaved like this for a long time so let's
not change this part of the API.
2013-07-24 01:49:18 +01:00
Zdenek Kabelac
5597dc3652 thin: not zeroing for non-zeroed thin pool snaps
Do not zero initial 4KB of thin snapshot volume for thin pool with
disabled zeroing.
2013-07-24 01:15:31 +02:00
Jonathan Brassow
d00d45a8b6 Clean-up: Addressing a few FIXME's
Three fixme's addressed in this commit:
1) lib/metadata/lv_manip.c:_calc_area_multiple() - this could be
   safely changed to a comment explaining that currently because
   RAID10 can only have a 2-way mirror, we don't need to know the
   number of stripes.  However, we will need to know that in the
   future if RAID10 is to support more than 2-way mirroring.

2) lib/metadata/mirror.c:_delete_lv() - should have been calling
   _activate_lv_like_model() with 'mirror_lv'.  This is because
   'mirror_lv' is the LV that the overall operation is being
   performed on.  We need to use this LV as the basis for
   determining whether to activate locally, or across the
   cluster, etc.

3) tools/lvcreate.c:_lvcreate_params() - Minor clean-up.  If
   '-m 0' is given, treat it as though the mirroring argument
   was not given (i.e. as though the requested segment type
   was 'stripe' and not mirror).
2013-07-23 14:46:22 -05:00
Tony Asleson
a2b5147600 lvm2app: lvm_vg_list_lvs filter hidden LVs
The function lvm_vg_list_lvs was returning all logical
volumes, including *_tmeta and *_tdata.  Added check
to verify that LV is visible before including in list
of returned logical volumes.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2013-07-23 14:01:20 -05:00
Peter Rajnoha
31de670318 lvconvert: add more checks for lvconvert --type
The --type mirror requires -m/--mirrrors:

  lvconvert --type mirror vg/lvol0
    --type mirror requires -m/--mirrors
    Run `lvconvert --help' for more information.

The --type raid* is allowed (the checks already existed):

  lvconvert --type raid10 vg/lvol0
    Converting the segment type for vg/lvol0 from linear to raid10 is not yet supported.

The --type snapshot is a synonym to -s/--snapshot:

  lvconvert -s vg/lvol0 vg/lvol1
    Logical volume lvol1 converted to snapshot.

  lvconvert --type snapshot vg/lvol0 vg/lvol1
    Logical volume lvol1 converted to snapshot.

All the other segment types are not supported, e.g.:

  lvconvert --type zero vg/lvol0
    Conversion using --type zero is not supported.
    Run `lvconvert --help' for more information.
2013-07-23 17:13:54 +02:00
Zdenek Kabelac
373f95a921 snapshot: update merging fix
Activation is needed only for clustered VG.
For non-clustered VG skip activation, since deactivate_lv()
is called without problems (no testing for lock presence).

(updates f6ded62291)
2013-07-23 15:15:04 +02:00
Zdenek Kabelac
6311be29e4 thin: use 64bit arithmetic for checking meta size
Avoid overflow since extents are just 32bit values.

(in release fix 87aca628)
2013-07-23 14:58:07 +02:00
Zdenek Kabelac
e0856393c8 cleanup: add explicit cast to proper enum type 2013-07-23 14:53:29 +02:00
Peter Rajnoha
9b1834f075 man: pvs -o ba_start,ba_size -> pv_ba_start,pv_ba_size 2013-07-23 14:45:30 +02:00
Alasdair G Kergon
83fb622598 deptree: don't remove live node on resume failure
When resuming a node needed by a higher layer of the tree,
if the resume fails, only remove it if the node did not
originally have a live table.

Ref. 97f8454ecc
2013-07-23 13:33:35 +01:00
Alasdair G Kergon
84801d7c34 thin: rename extend_pool to create_pool 2013-07-23 13:33:14 +01:00
Alasdair G Kergon
3670fe92ba cleanup: suppress compiler warning 2013-07-23 13:32:47 +01:00
Jonathan Brassow
eb5a6a0d1a Man Pages: Update man pages to reflect changes to various RAID options
Some of the names for various RAID options have been changed and the man
pages need to reflect it.
lvcreate:
	from: minrecoveryrate	to: [raid]minrecoveryrate
	from: maxrecoveryrate	to: [raid]maxrecoveryrate
	* plus better clarity on what the arg to these options is
	  specifying

lvchange:
	from: minrecoveryrate   to: [raid]minrecoveryrate
	from: maxrecoveryrate   to: [raid]maxrecoveryrate
	* plus better clarity on what the arg to these options is
	  specifying
	from: syncaction        to: [raid]syncaction
	from: writebehind	to  [raid]writebehind
	* plus change arg from BehindCount to IO/count
	from: writemostly	to: [raid]writemostly
	* plus addition to document [:{t|n|y}] option
lvs:
	from: mismatches	to: raid_mismatch_count
	from: sync_action	to: raid_sync_action
	add : raid_min|max_recovery_rate, raid_write_behind
2013-07-22 13:02:32 -05:00
Zdenek Kabelac
f6ded62291 snapshot: fix merging
When the merging of snapshot is finished, we need to clean dm table
intries for snapshot and -cow device. So for merging snapshot
we have to activate_lv plain 'cow' LV and let the table
resolver to its work - shortly deactivation_lv() request
will follow - in cluster this needs LV lock to be held by clvmd.

Also update a test - add small wait - if lvremove is not 'fast enough'
and merging process has not been stopped and $lv1 removed in background.
Ortherwise the following lvcreate occasionally finds name $lv1 still in use.

(in release fix)
2013-07-22 16:26:00 +02:00
Peter Rajnoha
6ca81a091c tests: comment about pvscan --cache return value 2013-07-22 15:57:18 +02:00
Jonathan Brassow
081308af30 TEST: Support testing new RAID features in RHEL6 kernels
We check the version number of dm-raid before testing certain
features to make sure they are present.  However, this has
become somewhat complicated by the fact that the version #'s
in the upstream kernel and the REHL6 kernel have been diverging.
This has been a necessity because the upstream kernel has
undergone ABI changes that have necessitated a bump in the
'Y' component of the version #, while the RHEL6 kernel has not.
Thus, we need to know that the ABI has not changed but the
features have been added.  So, the current version #'ing stands
as follows:

RHEL6   Upstream   Comment
======|==========|========
** Same until version 1.3.1 **
------|----------|--------
 N/A  |   1.4.0  | Non-functional change.
      |          | Removes arg from mapping function.
------|----------|--------
1.3.2 |   1.4.1  | RAID10 fix redundancy validation checks.
------|----------|--------
1.3.5 |   1.4.2  | Add RAID10 "far" and "offset" algorithm support.
      |          | Note this feature came later in RHEL6 as part of
      |          | a separate update/feature.
------|----------|--------
1.3.3 |   1.5.0  | Add message interface to allow manipulation of
      |          | the sync_action.
      |          | New status (STATUSTYPE_INFO) fields: sync_action
      |          | and mismatch_cnt.
------|----------|--------
1.3.4 |   1.5.1  | Add ability to restore transiently failed devices
      |          | on resume.
------|----------|--------
1.3.5 |   1.5.2  | 'mismatch_cnt' is zero unless [last_]sync_action
      |          | is "check".
------|----------|--------

To simplify, writemostly/writebehind, scrubbing, and transient device
failure restoration are all tested based on the same version
requirements: (1.3.5 < V < 1.4.0) || (V > 1.5.2).  Since kernel
support for writemostly/writebehind has been around for some time,
this could mean a reduction in the scope of kernels tested for this
feature.  I don't view this as much of a problem, since support for
this feature was only recently added to LVM.  Thus, the user would
have to be using a very recent LVM version with an older kernel.
2013-07-22 08:50:27 -05:00
Petr Rockai
3fdb45d040 pvscan: Respect lvmetad (global) filter in --cache w/ a device. 2013-07-22 15:05:39 +02:00
Peter Rajnoha
ea333a894e systemd: lvm2-activation-generator: use LOG_DEBUG/ERR severity for kmsg 2013-07-22 14:04:12 +02:00
Zdenek Kabelac
f1d5f6ae81 lvconvert: drop limit on thin pool conversion 2013-07-22 12:41:22 +02:00
Zdenek Kabelac
03efb7c2e1 python: make install to prefix dir
Respect $prefix and avoid install to live system.
2013-07-22 12:41:22 +02:00
Zdenek Kabelac
c394c2a624 dumpconfig: check conf tree was created
Missing error path.
2013-07-22 12:41:21 +02:00
Zdenek Kabelac
baada4316d liblvm: check lvmetad cache return values
Missing error path.
2013-07-22 12:41:21 +02:00
Zdenek Kabelac
dedec81d7b cleanup: do not return stack content
Return initialized struct in error path.
2013-07-22 12:41:21 +02:00
Zdenek Kabelac
aed4e9c703 coverity: pointer validation
Check for metadata_lv and make sure we have got proper thin pool segment.

Check we are working with merging snapshot when adding merging target.
2013-07-22 12:41:21 +02:00
Zdenek Kabelac
90bdbcc201 liblvm: check extents_from_size
Since the function may fail, check for error.
(in release fix)
2013-07-22 12:41:21 +02:00
Zdenek Kabelac
d4ad728610 cleanup: lvm complient style
drop unused assignments.
2013-07-22 12:41:21 +02:00
Zdenek Kabelac
05a70f2da3 cleanup: simplier string reset 2013-07-22 12:41:21 +02:00
Zdenek Kabelac
ea68f08501 cleanup: remove unused headers 2013-07-22 12:41:21 +02:00
Petr Rockai
6d2604f026 metadata: Fix tracking of read_status flags in _vg_make_handle. 2013-07-22 12:04:47 +02:00
Petr Rockai
3ed7f78ff4 metadata: Do not ignore errors in _vg_update_vg_ondisk. 2013-07-22 12:00:48 +02:00
Petr Rockai
bd60232d74 TEST: Add a regression test for the ondisk/orphan bug. 2013-07-22 11:57:23 +02:00
Petr Rockai
f897fcbd95 metadata: Do not try to maintain an ondisk copy of orphan VGs. 2013-07-22 11:51:35 +02:00
Jonathan Brassow
6aeb54c77c TEST: Update syncaction test to match latest kernel updates
The mismatch count reported by a dm-raid kernel target used
to be effectively random, unless it was checked after a
"check" scrubbing action had been performed.  Updates to the
kernel now mean that the mismatch count will be 0 unless a
check has been performed and discrepancies had been found.
This has been the intended behaviour all along.

This patch updates the test suite to handle the change.
2013-07-19 15:24:34 -05:00
Alasdair G Kergon
ccc29f17b6 cmdline: support ARG_GROUPABLE in merge_synonym 2013-07-19 20:37:43 +01:00
Alasdair G Kergon
90a09559ed commandline: add prefix aliases for raid options
Accept --raidwritemostly as well as --writemostly etc.
2013-07-19 19:24:54 +01:00
Jonathan Brassow
4eea660191 RAID: Fix segfault when reporting raid_syncaction field on older kernel
The status printed for dm-raid targets on older kernels does not include
the syncaction field.  This is handled by dev_manager_raid_status() just
fine by populating the raid status structure with NULL for that field.
However, lv_raid_sync_action() does not properly handle that field being
NULL.  So, check for it and return 0 if it is NULL.
2013-07-19 10:01:48 -05:00
Peter Rajnoha
f0ab6c33a9 dev-type: dev_get_primary_dev default error code 0, not -1 2013-07-19 15:26:53 +02:00
Alasdair G Kergon
da79fe4c1d reporting: tidy recent new fields
Add underscores and prefixes to recently-added fields.
(Might add more alias functionality in future.)
2013-07-19 01:30:02 +01:00
Tony Asleson
1a005b40a4 python-lvm: Add call to close/re-open C lib.
As the library handle has a dm pool associated with
it for long running processes it is required to close and
re-open the library to free the dm pool.  Call added so
python clients can reclaim memory, lvm.gc().

Note: Any python objects on the heap become invalid at the
time this call is made.  If referenced, a seg. fault could
occur.  No simple way to make this safe with the current
memory management in the C library.  Use with caution!

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2013-07-18 16:03:29 -05:00
Alasdair G Kergon
357df34133 display: fix units for sizes <1k 2013-07-18 17:55:58 +01:00
Zdenek Kabelac
ef3a1a0f8a thin: vgsplit and vgmerge spare support
When spliting a VG with spare, update to which VG it will belong.

When merging and both VGs have spare, unmark the smaller one first.
2013-07-18 18:22:44 +02:00
Zdenek Kabelac
aab53f46ee thin: add lvconvert pool metadata spare
Support poolmetadataspare when convering volumes into thin pool.
Same rules applied as with lvcreate.
2013-07-18 18:22:44 +02:00
Zdenek Kabelac
3075784955 thin: add spare lvcreate support
Add --poolmetadataspare option and creates and handles
pool metadata spare lv when thin pool is created.
With default setting 'y' it tries to ensure, spare has
at least the size of created LV.
2013-07-18 18:22:44 +02:00
Zdenek Kabelac
a916bf7eeb thin: removal of spare disables recovery
Warn user when removing spare LV.
Remove spare automatically, when last pool from VG is removed.
2013-07-18 18:22:44 +02:00
Zdenek Kabelac
915cc5a2fa thin: report 'e' volume type pool metadata spare
Reuse m'e'tadata volume type for spar'e' volume as well.
Essentially they are related and there is no big reason
to introduce new flag.
2013-07-18 18:22:44 +02:00
Zdenek Kabelac
460d0254eb thin: add pool metadata spare lv support
Add support for pool's metadata spare volume.
2013-07-18 18:22:43 +02:00
Zdenek Kabelac
08df7ba844 thin: improve pool creation activation order
Pool creation involves clearing of metadata device
which triggers udev watch rule we cannot udev synchronize with
in current code.

This metadata devices needs to be activated localy,
so in cluster mode deactivation and reactivation
is always needed.

However for non-clustered mode we may reload table
via suspend/resume path which avoids collision with
udev watch rule which was occasionaly triggering
retry deactivation loop.

Code has been also split into 2 separate code paths
for thin pools and thin volumes which improved readability
of the code as well.

Deactivation has been moved out of extend_pool() and
decision is now in _lv_create_an_lv() which knows
the change mode.
2013-07-18 18:22:43 +02:00