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

1229 Commits

Author SHA1 Message Date
mpatocka
4fb0ddedc7 WHATS_NEW 2009-07-13 23:16:17 +00:00
Alasdair Kergon
685bc7ae83 Make cmd->cmd_line const. 2009-07-13 19:49:48 +00:00
Alasdair Kergon
d0d0c1e5e5 Fix dev name mismatch in vgcreate man page example. 2009-07-13 11:25:35 +00:00
Dave Wysochanski
b003ae7270 Update WHATS_NEW for vgremove and ORPAHN_LOCK refactoring 2009-07-10 20:16:15 +00:00
snitzer
e27183d54f Check MD devices for a partition table during device scan. 2009-07-09 22:50:45 +00:00
snitzer
f49c31ddb2 Add extended device (blkext) and MD partition (mdp) types to filters.
Both types were added with a 'max_partitions' of 1 because these devices
are _not_ partitionable (they are the partitions).
2009-07-09 22:34:02 +00:00
Milan Broz
ac959238aa Fix and precise metadata read errors for segment areas. 2009-07-09 11:29:41 +00:00
Milan Broz
563b6561a5 Fix confusing metadata syntax error messages.
If there is syntax error in metadata, it now prints messages
like:
  Couldn't read 'start_extent' for segment 'extent_count'.
  Couldn't read all logical volumes for volume group vg_test.

The segment specification is wrong and confusing.

Patch fixes it by introducing "parent" member in config_node which
points to parent section and config_parent_name function, which
provides pointer to node section name.

Also it adds several LV references where possible.
2009-07-09 11:29:00 +00:00
Milan Broz
bc26690cbf Fix segment import functions to print segment name and logical volume name. 2009-07-09 11:28:09 +00:00
Dave Wysochanski
4f56896f60 Update WHATS_NEW for recent vgcreate changes 2009-07-09 10:19:07 +00:00
Dave Wysochanski
75c22b585e . 2009-07-08 22:22:12 +00:00
Dave Wysochanski
470aa36c91 Update WHATS_NEW for vgread cleanup 2009-07-08 14:41:00 +00:00
Alasdair Kergon
c2cd4d5d15 Permit several segment types to be registered by a single shared object. 2009-07-08 12:36:01 +00:00
snitzer
34fe80f9d9 Reword the WHATS_NEW commandline sizes update. 2009-07-06 19:17:15 +00:00
snitzer
15ae133662 Allow commandline sizes to be specified in terms of bytes and sectors.
Update the man pages to document size units uniformly.
2009-07-06 19:13:26 +00:00
snitzer
c405a5d5b3 Use the MD device's stripe-width, instead of chunk_size, to align the
data blocks of a Physical Volume that is placed directly upon an MD
device.
2009-07-06 19:04:24 +00:00
Alasdair Kergon
7099be8f44 clarification 2009-07-03 11:04:06 +00:00
Dave Wysochanski
86e8c36a75 Update WHATS_NEW for vg_read commits 2009-07-01 17:23:10 +00:00
Alasdair Kergon
8414c57026 post-release 2009-07-01 09:31:46 +00:00
Alasdair Kergon
ae2e7f0603 update date 2009-06-30 18:41:47 +00:00
Alasdair Kergon
7177c3b393 pre-release tidy up 2009-06-30 18:39:31 +00:00
Alasdair Kergon
273511037a pre-release 2009-06-26 10:57:30 +00:00
Alasdair Kergon
56d64f23bf revert last patch - let's do a release first 2009-06-26 10:55:57 +00:00
Dave Wysochanski
cfbeca5e65 Convert the straight instances of vg_lock_and_read to new vg_read(_for_update).
Sun May  3 11:40:51 CEST 2009  Petr Rockai <me@mornfall.net>
  * Convert the straight instances of vg_lock_and_read to new vg_read(_for_update).


Author: Petr Rockai <prockai@redhat.com>
Committer: Dave Wysochanski <dwysocha@redhat.com>
2009-06-26 09:47:36 +00:00
Alasdair Kergon
aaf9b56084 Abort if automatic metadata correction fails when reading VG to update it. 2009-06-26 09:19:13 +00:00
Alasdair Kergon
e0a953e27e Abort operation if automatic metadata correction in lvconvert fails. 2009-06-26 09:03:59 +00:00
Milan Broz
f7c1e5f60d Fix backward compatibility for major:minor query.
Is an application uses query and set major:minor
to device, it should not fallback to default major by default.

Add new function whoich allows that (and use it in lvm2).
2009-06-17 20:55:24 +00:00
Milan Broz
d64d33ed07 Add WHATS_NEW items. 2009-06-15 15:09:02 +00:00
Milan Broz
f147256697 Suggest use lvchange --resync when up converting not yet synced mirror. 2009-06-15 13:43:15 +00:00
Milan Broz
649cd608c1 Destroy toolcontext on exit in clvmd (fixes memory pool leaks). 2009-06-15 12:15:23 +00:00
Milan Broz
87c63e995b Fix lvconvert to not poll mirror if no conversion in progress. 2009-06-15 12:08:59 +00:00
Milan Broz
cd49c5bf66 Fix memory leaks in toolcontext error path.
E.g.
 # vgscan
  Parse error at byte 2360 (line 54): expected a value
  Failed to load config file /etc/lvm/lvm.conf
You have a memory leak (not released memory pool):
 [0x818c788] library (12 bytes)

...
2009-06-15 11:56:31 +00:00
Milan Broz
c3ca9468d1 Fix WHATS_NEW - Allow metadata correction even when PVs are missing. 2009-06-12 08:34:15 +00:00
Milan Broz
89576aa2c1 Re-instate partial activation support in clustered mode. (mornfall) 2009-06-12 08:30:19 +00:00
Zdeněk Kabeláč
33f41cc68b Use 'lvm lvresize' instead of 'lvresize' in fsadm.
Do not use '-n' realine option in fsadm for busybox compatiblity.
2009-06-09 15:31:36 +00:00
Dave Wysochanski
d8bee53822 Update WHATS_NEW 2009-06-09 14:43:59 +00:00
Milan Broz
42e922d587 Round readahead more inteligently and print warning.
Round readahead at least to one page up.
Print warning instead of verbose message.
2009-06-06 22:00:20 +00:00
Milan Broz
84abdc7b2d Fix double releasing of vg when repairing of vg is requested.
Several commands calls process_each_vg() and in provided
callback it explicitly recovers VG if inconsistent.
(vgchange, vgconvert, vgscan)

It means that old VG is released and reread  but the function
above (process_one_vg) tries to unlock and release old VG.

Patch moves the repair logic into _process_one_vg() function.

It always tries to read vg (even inconsistent) and then decides
what to do according new defined parameter.

Also patch unifies inconsistent error messages.

The only slight change if for vgremove command, where
it now tries to repair VG before it removes if force arg is given.
(It works similar way before, just the order of operation changed).
2009-06-05 20:00:52 +00:00
Milan Broz
cf9dd7cf5e Use lvconvert --repair instead of vgreduce in mirror dmeventd DSO (mornfall)
Introduce lvconvert --use_policies (mornfall)
2009-06-04 12:01:15 +00:00
Christine Caulfield
2897cfb556 Fix clvmd-corosync to match the new corosync API. 2009-06-03 13:42:02 +00:00
Milan Broz
5484869af9 WHATS_NEW! 2009-06-03 11:49:05 +00:00
Milan Broz
488d246ada Fix rename of active snapshot with virtual origin.
Code must suspend/resume virtual origin too when renaming
snaphsot otherwise in kernel old name remains.
2009-06-01 15:55:06 +00:00
Milan Broz
8189910b5a Fix convert polling to ignore LV with different UUID.
When mirror convert polling is started (mainly as backgound process,
in lvchange -a y or in lvconvert itself) it tries to read VG
and LV identified by its name.

Unfortunatelly, the VG can have already different LV under the same name,
and various more or less funny things can happen (note that
_finish_lvconvert_mirror suspends the volume for example).

(the typical example is our testing script which continuously recreates
LVs under the same name in the same VG.)

This patch adds optional uuid parameter which helps to properly
select the monitoring object. For lvconvert polling it is set to LV UUID
and both _get_lvconvert_vg and _get_lvconvert_lv uses it to read proper VG/LV.

(In the pvmove case it is NULL, here we poll for physical volume name).
2009-06-01 14:43:27 +00:00
Milan Broz
436cf94595 Fix readahead calculation problems.
During vgreduce is failed mirror image replaced with error segment,
this segmant type has always area_count == 0.
Current code expects that there is at least one area with device,
patch fixes it by additional check (fixes segfault during vgreduce).

Also do not calculate readahead in every lv_info call, we only need
to cache PV readahead before activation calls which locks memory.
2009-06-01 12:43:31 +00:00
Alasdair Kergon
145c999762 Remove verbose 'visited' messages. 2009-05-30 01:54:29 +00:00
Alasdair Kergon
c82b46032a Handle multi-extent mirror log allocation when smallest PV has only 1 extent. 2009-05-30 00:09:27 +00:00
snitzer
d5139fef22 Fix rpmlint in clvmd initscript
Added missing LSB stanza lines.
Added reload capability.
Remaining warning (incoherent-init-script-name) is not relevant.
2009-05-29 18:34:10 +00:00
Alasdair Kergon
f8964db41c When creating new LV, double-check that name is not already in use. 2009-05-28 01:59:37 +00:00
Alasdair Kergon
052169695c Remove /dev/vgname/lvname symlink automatically if LV is no longer visible. 2009-05-28 01:11:29 +00:00
Alasdair Kergon
f9a8a94fd1 Rename internal vorigin LV to match visible LV. 2009-05-28 00:29:14 +00:00
Alasdair Kergon
880d9bb33f Suppress 'removed' messages displayed when internal LVs are removed.
Fix lvchange -a and -p for sparse LVs.
Fix lvcreate --virtualsize to activate the new device immediately.
2009-05-27 18:19:21 +00:00
Alasdair Kergon
68aa3eb1b9 Make --snapshot optional with lvcreate --virtualsize.
Generalise --virtualoriginsize to --virtualsize.
2009-05-27 16:30:29 +00:00
Alasdair Kergon
39dbb9dad8 Skip virtual origins in process_each_lv_in_vg(). (mbroz) 2009-05-27 13:23:41 +00:00
Alasdair Kergon
ac7acf2441 Fix counting of virtual origin LVs in vg_validate. (mbroz) 2009-05-27 13:19:34 +00:00
Alasdair Kergon
24f3c8c29e Attempt to load dm-zero module if zero target needed but not present. (mbroz) 2009-05-27 13:05:53 +00:00
Alasdair Kergon
cf578d50ec post-release 2009-05-22 15:23:10 +00:00
Alasdair Kergon
01280bbd06 Rename liblvm.so to liblvm2app.so and use configure --enable-applib. 2009-05-22 14:44:59 +00:00
Alasdair Kergon
0f1b7a527b Reinstate version in liblvm2cmd.so soname. (2.02.44) 2009-05-21 11:11:29 +00:00
Alasdair Kergon
965c7e1200 Pre-release cleanups. 2009-05-21 03:04:52 +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
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
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
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
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
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
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
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
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
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
Petr Rockai
057983ce3e Update WHATS_NEW wrt a recent patch. 2009-05-09 13:47:03 +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
Alasdair Kergon
174f5a3a49 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
Petr Rockai
40cd0b1dd2 Implement, test and document (first iteration of) lvconvert --repair. 2009-04-23 16:56:21 +00:00
Milan Broz
16c4b2a572 Fix vgreduce --removemissing failure exit code. 2009-04-22 17:00:28 +00:00
Milan Broz
9e959f9bdd Fix remote metadata backup for clvmd
Run backup of metadata on remote nodes in the
same place like local node - when calling backup().

Introduce backup_locally() which calls only
local backup if needed.

Remote backup is now trigerred by LCK_VG_BACKUP flag
combination (special VG lock).

This lock type will call check_current_backup()
(including backup_locally() call) and updates
metadata on all nodes.

(Patch fixes non-functional remote backup,
current call during VG lock never triggers.)
2009-04-22 09:39:45 +00:00
Milan Broz
3ec8c63e28 Alloc PV internal structure from VG mempool if possible. 2009-04-22 09:31:30 +00:00
Milan Broz
5800560602 Move metadata backup call after vg_commit.
The backup() call store metadata from memory.

But in cluster backup() call performs
remote nodes metadata backup and it reads data from disk.

For metadata backup consistency,
patch moves all backup() calls after vg_commit.

(Moreover, some tools already do that this way.)
2009-04-21 14:31:57 +00:00
Milan Broz
a840a56e02 Tidy lv_hash[_lock] use inside clvmd.
- Rename unlock_all to destroy_lvhash,
this function is called in cluster shutdown
unlocks everything and clean up allocated info space.

 - Tidy lv_hash_lock use
.
Except adding free(lvi) in lv_has destructror
there is no functional change.
2009-04-21 13:11:28 +00:00
Milan Broz
8704f4e24e Fix pvseg report for orphan PVs and other devices.
If user requests report attribute from PVSEG type
and PV is orphan (or all devices is set), the report
is empty.

Try for example (when only orphan PV are present)
 #pvs
 #pvs -o +devices
# pvs /dev/sdb1
  PV         VG   Fmt  Attr PSize  PFree
    /dev/sdb1       lvm2 --   46.58G 46.58G
# pvs -o +devices /dev/sdb1
(no output)

The problem is caused by empty pv->segments list.

Fix it by providing fake segment here (similar to fake structures
in _pvsegs_sub_single() calls.
2009-04-21 12:59:18 +00:00
Milan Broz
459a5a5b1f Fix pvs -a for segmented output
# pvs -a -o devices
   Volume group name (null) has invalid characters
   Skipping volume group (null)

...
_pvsegs_sub_single creates fake vg, we need to check
that pv is real here.
2009-04-21 12:57:31 +00:00
Milan Broz
6772b45ea6 Add MMC device type to filters. 2009-04-16 10:16:14 +00:00
Milan Broz
06bdf8b461 Introduce memory pool per volume group.
Since now, all code reading volume group is responsible for releasing
the memory allocated by calling vg_release(vg).
(For simplicity of use, vg_releae can be called for vg == NULL,
the same logic like free(NULL)).

Also providing simple macro for unlocking & releasing in one step,
tools usualy uses this approach.

The global memory pool (cmd->mem) should be used only for global
physical volume operations.

This patch have to be applied with all subsequent patches to complete
memory pool per vg logic.

Using separate memory pool has quite bit memory saving impact when
using large VGs, this is mainly needed when we have to use
preallocated and locked memory (and should not overflow from that
memory space).
2009-04-10 09:59:18 +00:00
Milan Broz
d784303591 Helper function to catch memory pool leaks. 2009-04-10 09:56:58 +00:00
Milan Broz
52d2c31427 Properly copy the whole pv structure for later use.
The all_pvs list, used in vg_read, should make its own private
copy of pv structures, otherwise (when vg will use its own pool)
it will point to released memory pool.
The same applies for get_pvs() call.

Patch adds pv_list copy helper and adds explicit memory pool
parameter into _copy_pv.

(Please note that all these helper functions cannot guarantee that
vg related fields are valid - proper vg read & lock must be used
if it is requested.)
2009-04-10 09:56:00 +00:00
Milan Broz
9bc8e56458 Always return exit error status when locking of volume group fails. 2009-04-10 09:54:36 +00:00
Milan Broz
489c728793 Fix mirror log convert validation question. 2009-04-10 09:53:42 +00:00
Zdeněk Kabeláč
01eaadfa53 Avoid referencing files from DESTDIR during build process 2009-04-08 14:08:05 +00:00
Zdeněk Kabeláč
dddd2f9202 Do not create some dm and lvm static librarie when they are not requested
by configure option
Add dependency for static dmeventd library
2009-04-08 14:04:35 +00:00