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

3318 Commits

Author SHA1 Message Date
Alasdair Kergon
abea4f481c Missing entries. 2009-05-20 22:44:10 +00:00
Alasdair Kergon
71191eae5c Revert:
Use lvconvert --repair in dmeventd mirror DSO.
for now.

It replaces bad behaviour in one set of circumstances with bad behaviour
in a different set.  We think the behaviour needs to be more configurable.
2009-05-20 22:24:48 +00:00
Milan Broz
03d4efc5c0 Fix locking query compatibility with old external locking libraries. 2009-05-20 12:58:03 +00:00
Milan Broz
22c38019b2 Fix readahead test. 2009-05-20 11:27:14 +00:00
Milan Broz
7cd8194c99 Use readahead of underlying device and not default (smaller) one.
When we are stacking LV over device, which has for some reason
increased read_ahead (e.g. MD RAID), the read_ahead hint
for libdevmapper is wrong (it is zero).

If the calculated read_ahead hint is zero, patch uses read_ahead of underlying device
(if first segment is PV) when setting DM_READ_AHEAD_MINIMUM_FLAG.

Because we are using dev-cache, it also store this value to cache for future use
(if several LVs are over one PV, BLKRAGET is called only once for underlying device.)

This should fix all the reamining problems with readahead mismatch reported
for DM over MD configurations (and similar cases).
2009-05-20 11:09:49 +00:00
Milan Broz
b4747ad67f Use lock query instead of activate_lv_excl
- switch lvremove to not force activate volume when removing
 - ditto for force resync

 - fix some wrong return codes in lvchange_resync()
2009-05-20 09:55:33 +00:00
Milan Broz
bb6db55686 Use suspend with flush when device size was changed during table preload.
This allows online mirror resize, also removes condition to preventing
code to do this.
2009-05-20 09:52:37 +00:00
Dave Wysochanski
244cd8f94f Add test - lvconvert from linear (on multiple PVs) to mirror. 2009-05-19 15:47:50 +00:00
Milan Broz
ba856910e0 Add infrastructure for queriying for remote locks.
Current code, when need to ensure that volume is not
active on remote node, it need to try to exclusive
activate volume.

Patch adds simple clvmd command which queries all nodes
for lock for given resource.

The lock type is returned in reply in text.

(But code currently uses CR and EX modes only.)
2009-05-19 10:38:58 +00:00
Milan Broz
d00e023894 Fix lvconvert check for multiple-segment mirrors (mornfall) 2009-05-19 10:27:47 +00:00
Milan Broz
86b4b128a9 Use lvconvert --repair in dmeventd DSO (mornfall)
This means two things:

1) Non-mirrored LVs will be no longer affected by mirror monitoring. (Before,
if you had a LV that went partially missing on a VG where a mirror leg failed,
this LV would be removed automatically by dmeventd... Probably not an
unrecoverable dataloss bug, but still quite unpleasant.)

2) If enough parallel PV space is available at the time of the mirror failure,
the failed devices will be automatically replaced using this spare space. Which
(and whether) free space may be used is still not configurable, but is a
planned feature. Since it is relatively easy to undo the action by converting
the mirror manually, I don't consider this to be a showstopper. In fact, I
think the compromise is much better than what we have now.
2009-05-19 10:25:16 +00:00
Milan Broz
35bd06a9a0 Fix compilation warning. 2009-05-19 10:12:41 +00:00
Milan Broz
bdc7574fd5 If pvmove fails activating mirror volume, try restore to previous state.
pvmove now keep suspended devices if temporary mirror creation fails.

We can try to restore previous state if it is first attempt to activate
pvmove (code basically run the same code as --abort automatically).
2009-05-19 09:51:02 +00:00
Milan Broz
a7cac2463c Use PV UUID in hash for device name when exporting metadata.
Currently code uses pv_dev_name() for hash when getting internal
"pvX" name.

This produce corrupted metadata if PVs are missing, pv->dev
is NULL and all these missing devices returns one name
(using "unknown device" for all missing devices as hash key).
2009-05-19 09:48:32 +00:00
Milan Broz
474bc8823e vgcfgrestore should not quietly fail when backup file has missing PVs.
(fixes previous commit: Fix segfault for vgcfgrestore on VG with missing PVs.)
2009-05-19 09:45:33 +00:00
snitzer
95f6b0c06e Add vgimportclone and install it and the man page by default. 2009-05-14 16:46:12 +00:00
Milan Broz
dc205333cd Check max_lv on only place and force the check only for new volume.
We can temporarily violate max_lv during mirror conversion etc.

(If the operation fails, orphan mirror images are visible to administrator
for manual remove for example. Not that this should ever happen:-)

Force limit only for lvcreate (and vg merge) command.

Patch also adds simple max_lv tests into testsuite
2009-05-13 21:29:10 +00:00
Milan Broz
4de96ea715 Remove unneeded import parameter from lv_create_empty. 2009-05-13 21:28:31 +00:00
Milan Broz
c94f02648c Merge lv_is_displayable and lv_is_visible.
Displayable and visible is the same thing.

volumes_count(vg) is now vg_visible_lvs() and always
returns number of LVs from user perspective.
2009-05-13 21:27:43 +00:00
Milan Broz
2ba0dd20fb Introduce lv_set_visible & lv_set_invisible and use lv_is_visible always.
The vg->lv_count parameter now includes always number of visible
logical volumes.

Note that virtual snapshot volume (snapshotX) is never visible,
but it is stored in metadata with visible flag.
2009-05-13 21:26:45 +00:00
Milan Broz
389dc22856 Fix lv_is_visible to handle virtual origin.
Snapshot is visible if its origin is marked visible,
or if the origin is virtual.
2009-05-13 21:25:45 +00:00
Milan Broz
823c8af1ab Introduce link_lv_to_vg and unlink_lv_from_vg functions.
link_lv_to_vg and unlink_lv_from_vg are the only functions
for adding/removing logical volume from volume group.

Only these function should manipulate with vg->lvs list.
2009-05-13 21:25:01 +00:00
Milan Broz
286562d202 Tidy format1 import LV function.
Later patch initializes lv->vg after the LV structure is prepared,
so pass through cmd context and do not use vg->cmd here.
Also move LV id calculation (which uses lv->vg too).

Also properly free memory pool if operation fails.
2009-05-13 21:24:12 +00:00
Milan Broz
b83a1876ba Remove vg->lv_count and use counter function.
This should not cause problems but simplifies code a lot.

(the volumes_count is merged and renamed with lvs_visible
function by following patch.)
2009-05-13 21:22:57 +00:00
Milan Broz
ed2a931ae3 Fix snapshot segment import to not use duplicate segments & replace.
The snapshot segment (snapshotX) is created twice
during the text metadata segment processing.

This can cause temporary violation of max_lv count.

Simplify the code, snapshot segment is properly initialized
in init_snapshot_seg function now and do not need to be replaced
by vg_add_snapshot call.

The vg_add_snapshot() is now usefull only for adding new
snapshot and it shares the same initialization function.

The snapshot name is always generated, name paramater can be
removed from function call.
2009-05-13 21:21:58 +00:00
Dave Wysochanski
f77190f477 Update test-utils to cope with ":" in device names and allow configurable names. 2009-05-13 19:18:47 +00:00
Zdeněk Kabeláč
2d3335fa48 Do not query nonexistent devices for readahead. 2009-05-13 14:13:54 +00:00
Dave Wysochanski
d52b3fd3fe Remove NON_BLOCKING lock flag from tools and set a policy to auto-set.
As a simplification to the tools and further liblvm, this patch pushes
the setting of NON_BLOCKING lock flag inside the lock_vol() call.
The policy we set is if any existing VGs are currently locked, we
set the NON_BLOCKING flag.

Should be no functional change.
2009-05-13 13:02:52 +00:00
Alasdair Kergon
5a945afdc6 better variable name for snapshot counting 2009-05-13 01:48:18 +00:00
Milan Broz
8b65ad0237 Remove snapshot_count from VG and use function instead. 2009-05-12 19:12:09 +00:00
Milan Broz
6d74246c91 Fix first_seg() call for empty segment list.
The seg variable is temporary variable for list iterator,
code cannot expect that after iteration it remains NULL
(it contains non-NULL pointer here id list is empty).

Patch fixes first_seg function so it now correctly returns NULL
for empty segment list.
2009-05-12 19:09:21 +00:00
Dave Wysochanski
9d81c953c3 Update t-read-ahead.sh to validate lv_read_ahead and lv_kernel_read_ahead.
- check default values
- check active/inactive values
2009-05-11 16:17:12 +00:00
Milan Broz
97e41de23f Fix previous commit (scripts/Makefile targets order) 2009-05-11 10:35:00 +00:00
Milan Broz
d57543b220 Introduce lvm2_install target.
Buildsystem support device-mapper only install,
but generic install tagret includes both dm+lvm2.

For distribution which uses separate install_device-mapper,
there is no way how to install lvm2 only
(so after installing lvm2 for packaging purposes
built system must remove installed device-mapper files).

Fix it by allowing lvm2_install target, similarily like
install_cluster for clvmd.

(install = install_device-mapper + install_lvm2)
2009-05-11 10:28:45 +00:00
Milan Broz
13cd91bffb Fix device-mapper static build targets.
dmsetup.static is not built and cleaned properly
if running only device-mapper install/build.
2009-05-11 10:13:28 +00:00
Milan Broz
2d170dfed8 Do not use generic install if running install_device-mapper.
It propagates into subdirs which includes DSOs which requires
lvm2 build (only install_device-mapper should propagate there).
2009-05-11 10:12:35 +00:00
Dave Wysochanski
744ac0eb81 Add test for seg_start, seg_count, seg_start_pe 2009-05-11 03:37:34 +00:00
Petr Rockai
057983ce3e Update WHATS_NEW wrt a recent patch. 2009-05-09 13:47:03 +00:00
Dave Wysochanski
aadc34ab4d Update tests for region_size. 2009-05-08 21:50:20 +00:00
Dave Wysochanski
d9c4af46ed Add tests to check pv_mda_size and vg_mda_size. 2009-05-08 06:10:45 +00:00
Dave Wysochanski
cdd0024bad Add tests to check vgcreate --physicalextentsize and field vg_extent_size. 2009-05-08 05:15:52 +00:00
Dave Wysochanski
6e331c523f Validate chunksize and originsize for snapshots. 2009-05-08 04:24:52 +00:00
Milan Broz
f7712c77b8 Fix PV datalign when for values starting prior to MDA area.
The dataalign value must always be aligned according
to MDA area.
The currect code checks if calculated value collides with
MDA area but not if the value is so small that it is
located before MDA starts.

Unfortunatelly there can be also MDA in the end of the device.

The patch adds simple check to avoid this miscalculation.
Patch expects that first MDA always starts on <= pagesize boundary
(this is true for all allowed label sector parameters).
2009-05-07 12:11:50 +00:00
Milan Broz
fd436c316a Use zalloc in initialization of device manager (to zero pvmove mirror count). 2009-05-07 12:01:21 +00:00
Dave Wysochanski
7120f7df54 Update columns.h comment. 2009-05-06 15:25:23 +00:00
Dave Wysochanski
1d30bf8af4 Fixup whitespace. 2009-04-29 20:14:21 +00:00
Dave Wysochanski
40c70e12dd Fixup whitespace. 2009-04-29 20:11:46 +00:00
Dave Wysochanski
31b6eb916f Use liblvm.so instead of .a 2009-04-28 19:08:25 +00:00
Dave Wysochanski
09e7a582de Fix error path in vg_make_handle().
Enter the error condition if either of the allocations fail, and
don't use dm_pool_zalloc if dm_pool_create fails.
2009-04-28 17:46:47 +00:00
Peter Rajnoha
b8aec00dee Fix wrong arg in lv_is_virtual_origin call while creating snapshots. 2009-04-26 08:12:12 +00:00