1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 03:27:58 +03:00
Commit Graph

3309 Commits

Author SHA1 Message Date
Milan Broz
8dd0ae923b Fix lvconvert check for multiple-segment mirrors (mornfall) 2009-05-19 10:27:47 +00:00
Milan Broz
ac0034c20f 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
94994d7e74 Fix compilation warning. 2009-05-19 10:12:41 +00:00
Milan Broz
65edd11bfb 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
e1b0dce76e 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
0a5e42897e 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
Mike Snitzer
761e574190 Add vgimportclone and install it and the man page by default. 2009-05-14 16:46:12 +00:00
Milan Broz
970f241c52 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
82cf926094 Remove unneeded import parameter from lv_create_empty. 2009-05-13 21:28:31 +00:00
Milan Broz
afd9ba98c1 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
59d8429cb3 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
b14c5af76d 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
0b706ac672 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
494b4cec7b 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
d60f341d96 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
4b13d5a823 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
3a5d73beb0 Update test-utils to cope with ":" in device names and allow configurable names. 2009-05-13 19:18:47 +00:00
Zdenek Kabelac
cfebc626b6 Do not query nonexistent devices for readahead. 2009-05-13 14:13:54 +00:00
Dave Wysochanski
5a820745ce 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
b44e3bdc86 better variable name for snapshot counting 2009-05-13 01:48:18 +00:00
Milan Broz
2f9a9d1a7f Remove snapshot_count from VG and use function instead. 2009-05-12 19:12:09 +00:00
Milan Broz
920e68d603 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
1cbdc00ecc 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
96e09924da Fix previous commit (scripts/Makefile targets order) 2009-05-11 10:35:00 +00:00
Milan Broz
0b502933c5 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
19363a13b1 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
be82186cba 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
aa1bcec8d2 Add test for seg_start, seg_count, seg_start_pe 2009-05-11 03:37:34 +00:00
Petr Rockai
45aff0a2bb Update WHATS_NEW wrt a recent patch. 2009-05-09 13:47:03 +00:00
Dave Wysochanski
614e02904a Update tests for region_size. 2009-05-08 21:50:20 +00:00
Dave Wysochanski
031966bdb0 Add tests to check pv_mda_size and vg_mda_size. 2009-05-08 06:10:45 +00:00
Dave Wysochanski
31424a53ee Add tests to check vgcreate --physicalextentsize and field vg_extent_size. 2009-05-08 05:15:52 +00:00
Dave Wysochanski
eb7d3facea Validate chunksize and originsize for snapshots. 2009-05-08 04:24:52 +00:00
Milan Broz
5c93cdba2d 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
610646095b Use zalloc in initialization of device manager (to zero pvmove mirror count). 2009-05-07 12:01:21 +00:00
Dave Wysochanski
14f5aa2753 Update columns.h comment. 2009-05-06 15:25:23 +00:00
Dave Wysochanski
c5185d4c03 Fixup whitespace. 2009-04-29 20:14:21 +00:00
Dave Wysochanski
1fa92933b5 Fixup whitespace. 2009-04-29 20:11:46 +00:00
Dave Wysochanski
4afec75e94 Use liblvm.so instead of .a 2009-04-28 19:08:25 +00:00
Dave Wysochanski
e08ad14696 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
7833b01291 Fix wrong arg in lv_is_virtual_origin call while creating snapshots. 2009-04-26 08:12:12 +00:00
Alasdair Kergon
87f42fda5e Add sparse devices: lvcreate -s --virtualoriginsize (hidden zero origin).
Add lvs origin_size field.
Fix linux configure --enable-debug to exclude -O2.

Still a few rough edges, but hopefully usable now:
  lvcreate -s vg1 -L 100M --virtualoriginsize 1T
2009-04-25 01:17:59 +00:00
Alasdair Kergon
7f54ef36dc Fix linux configure --enable-debug to exclude -O2. 2009-04-24 21:44:15 +00:00
Milan Broz
bf3423d355 Fix pool leak in lvmcache_read_vg error path.
(Introduced in previous patches.)
2009-04-24 12:03:55 +00:00
Peter Rajnoha
2dce31a16a Fix segfault when using -U, -G and -M options in dmsetup. 2009-04-24 11:30:49 +00:00
Petr Rockai
3802b91a4a Avoid scanning non-PV devices in functional tests, otherwise lvconvert --repair
breaks for some reason -- possibly needs investagation, but this should fix it
in the meantime.
2009-04-24 08:00:48 +00:00
Petr Rockai
eb23252b61 Implement, test and document (first iteration of) lvconvert --repair. 2009-04-23 16:56:21 +00:00
Petr Rockai
54120cb254 Refuse adding missing PVs in create_pv_list in toollib when allocatable_only is
requested.
2009-04-23 16:45:30 +00:00
Petr Rockai
e1ea382999 A more thorough PV equality test (that also copes better with MISSING_PVs) in
_is_mirror_image_removable.
2009-04-23 16:43:01 +00:00
Petr Rockai
eeadae1b6a Do not include MISSING_PVs in allocation maps. 2009-04-23 16:41:27 +00:00