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

3248 Commits

Author SHA1 Message Date
Milan Broz
81c7482974 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
Dave Wysochanski
96bfa40b47 Add libdevmapper to test/api building. 2009-04-20 20:46:06 +00:00
Milan Broz
1cc75dfb53 Add MMC device type to filters. 2009-04-16 10:16:14 +00:00
Milan Broz
19061a1a15 Fix dmsetup.static build. 2009-04-15 14:42:27 +00:00
Milan Broz
043b13625b Properly release VG memory pool in all CLI tools. 2009-04-10 10:01:38 +00:00
Milan Broz
405366fd48 Properly release VG memory pool in metadata manipulation code. 2009-04-10 10:01:08 +00:00
Milan Broz
fc310448c0 Properly release VG memory pool in archiver code. 2009-04-10 10:00:37 +00:00
Milan Broz
095bbca691 Properly release VG memory pool in activation code and clvmd. 2009-04-10 10:00:04 +00:00
Milan Broz
8e1d5615b4 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
d828b9a4d7 Helper function to catch memory pool leaks. 2009-04-10 09:56:58 +00:00
Milan Broz
6fe905c705 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
1b25b6e009 Always return exit error status when locking of volume group fails. 2009-04-10 09:54:36 +00:00
Milan Broz
6ce8f8d553 Fix mirror log convert validation question. 2009-04-10 09:53:42 +00:00
Zdenek Kabelac
9bcd5c2ffc Avoid referencing files from DESTDIR during build process 2009-04-08 14:08:05 +00:00
Zdenek Kabelac
beeae21dbb 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
Milan Broz
772cac09e3 Enable use of cached metadata for pvs & pvdisplay.
Currently PV commands, which performs full device scan, repeatly
re-reads PVs and scans for all devices.

This behaviour can lead to OOM for large VG.

This patch allows using internal metadata cache for pvs & pvdisplay,
so the commands scan the PVs only once.
(We have to use VG_GLOBAL otherwise cache is invalidated on every
VG unlock in process_single PV call.)
2009-04-08 12:53:20 +00:00
Alasdair Kergon
bef749c942 Add missing 'device-mapper' internal subdir build dependency. 2009-04-07 22:53:48 +00:00
Milan Broz
0377a6de21 Use pv from newly read_vg to avoid possible use of not initialized memory.
If the vg in process_each_segment_in_pv is NULL, the pv struct
can be incomplete (for example lv_segs are not copied in get_pvs()
call).

We need use the new pv from just read-in volume group.

(The same code is in pvdisplay already.)
2009-04-07 10:22:14 +00:00
Milan Broz
e24f357c23 Fix memory pool leak.
Call the alloc_destory call always after finishing operation
with handle otherwise it will leak a memory pool.

Also fix return code in lv_extend.
2009-04-07 10:20:28 +00:00
Dave Wysochanski
6d1208546d Fix whitespace in t-mdata-strings.sh
Author: Dave Wysochanski <dwysocha@redhat.com>
2009-04-03 14:23:17 +00:00
Takahiro Yasui
2691077d90 Save and restore the previous logging level when log level is changed. 2009-04-02 21:34:41 +00:00
Takahiro Yasui
e69246e1b7 Fix error message when archive initialization fails. 2009-04-02 20:46:11 +00:00
Milan Broz
fe41c21be9 Fix debug pool grow object to properly support delta=0
(It prints garbage for some reports)
2009-04-02 15:02:18 +00:00
Milan Broz
ec5703ea07 Allocate new pv->vg_name from pool, it can be destroyed later.
(The mempool rename will be used later by vg private mempools)
2009-04-02 15:01:11 +00:00
Milan Broz
212a510f04 Do not use pointer from released memory pool (cmd->cmd_line). 2009-04-02 14:59:48 +00:00
Christine Caulfield
3330038ebc Make sure clvmd-corosync releases the lockspace when it exits.
patch from Xinwei Hu
2009-04-01 07:51:05 +00:00
Milan Broz
8f85721f00 Add some more special chars for device name test. 2009-03-31 17:30:47 +00:00
Milan Broz
aa8111b3cd fix some issues when compiling with -D DEBUG_POOL
- fix compilation issues
- fix wrong pool object maipulation (lvm dumpconfig triggers assert)
- second iteration in loop _log_parallel_areas operates on non-existing object
2009-03-26 09:25:18 +00:00
Milan Broz
0ef8308f1b Fix segfault for vgcfgrestore on VG with missing PVs. 2009-03-24 13:16:34 +00:00
Christine Caulfield
c35df82da9 Block SIGINT & SIGTERM in clvmd subthreads so they don't delay shutdown.
Patch from Xinwei Hu, Thanks
2009-03-24 11:49:15 +00:00
Takahiro Yasui
fbd97a3425 Restore log_suppress state when metadata backup file is up-to-date.
Author: Takahiro Yasui <tyasui@redhat.com>
2009-03-23 22:57:27 +00:00
Takahiro Yasui
36881b0133 Remove old metadata backup file after renaming vg.
Author: Takahiro Yasui <tyasui@redhat.com>
2009-03-23 22:29:06 +00:00
Takahiro Yasui
6a8feb3c26 Fix size and error message of memory allocation at backup initialization.
Author: Takahiro Yasui <tyasui@redhat.com>
2009-03-23 21:56:32 +00:00
Takahiro Yasui
1d13e51826 Fix error message when adding metadata directory to internal list fails.
Author: Takahiro Yasui <tyasui@redhat.com>
2009-03-23 21:13:37 +00:00
Petr Rockai
1b2e147cc8 Missed file from previous checkin. 2009-03-17 14:40:00 +00:00
Petr Rockai
a9d72f0e9d Some extra (paranoid) checks on dev_is_{md,swap} result. 2009-03-17 14:00:58 +00:00
Petr Rockai
3402ccd488 Detect and wipe swap signatures in pvcreate. 2009-03-17 13:59:56 +00:00
Dave Wysochanski
d917c98cd8 Fix some clean rules, fix previous distclean checkin.
In libdm/Makefile.in, we need to cleanup the symlink properly.
Adding to CLEAN_TARGETS seemed like the simplest way to do this
in the current build framework.  We could redo dependencies for
VERSIONED_SHLIB, but for now just add to CLEAN_TARGETS.

For scripts/Makefile.in, we should be adding to DISTCLEAN_TARGETS.
The generic rule in make.tmpl.in takes care of the cleanup.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Author: Takahiro Yasui <tyasui@redhat.com>
2009-03-16 20:00:10 +00:00
Dave Wysochanski
f5ac9a9495 Fix some distclean rules.
By gnu coding stds, 'distclean' should remove all files generated
by ./configure in addition to what 'clean' does.

Author: Takahiro Yasui <tyasui@redhat.com>
2009-03-16 18:28:04 +00:00
Milan Broz
d726767f14 Fix warning in previous commit. 2009-03-16 15:19:29 +00:00
Milan Broz
7f436a0f39 Fix lv_count when manipulating with snapshots and max_lv is set.
Patch fixes these problems:
 - during the snapshot creation process, it needs create 2 LVs,
   one is cow, second becomes snapshot.
   If the code fails in vg_add_snapshot, code lvcreate will not remove
   LV cow volume.

 - if max_lv is set and VG contains snapshot, it can happen that
   during the activation lv_count is temporarily increased over the limit
   and VG metadata are not properly processed
   see https://bugzilla.redhat.com/show_bug.cgi?id=490298

 - vgcfgrestore alows restore with max_lv set to lower valuer that actual
   LV count. This later leads to situation that max_lv is completely ignored.

 - vgck doesn't call vg_validate(). It should at least try:-)

Signed-off-by: Milan Broz <mbroz@redhat.com>
2009-03-16 14:34:57 +00:00
Dave Wysochanski
470304e2a2 Remove unnecessary includes in lvm_base.c.
We would like to declare our handles pv_t, vg_t, and lv_t in
the external library header lvm.h.  However, these are already
defined in metadata-exported.h for the use of some of the
in-progress liblvm APIs.  Thus, we cannot both define
them in lvm.h and include metadata-exported.h in the external
library C files.  We could use preprocessor tricks (#ifndef)
but for now we just avoid the include.
2009-03-10 15:38:46 +00:00
Milan Broz
01a3cb443e Fix clvmd build after liblvm commit. 2009-03-10 12:10:12 +00:00
Dave Wysochanski
47e1baf1e4 Fix error messages when PV uuid or pe_start reading fails.
Author: Takahiro Yasui <tyasui@redhat.com>
Committer: Dave Wysochanski <dwysocha@redhat.com>
2009-03-09 15:42:10 +00:00
Dave Wysochanski
d0e0cb9973 Add missing liblvm/.exported_symbols 2009-03-08 18:58:53 +00:00
Dave Wysochanski
fac0314c58 Fix liblvm version symlink. 2009-03-08 18:10:39 +00:00
Dave Wysochanski
4df86ce1ac Remove unnecessary linker flags for liblvm. 2009-03-08 17:29:26 +00:00
Dave Wysochanski
77986fa71a Add DSO generation for new LVM application library.
Fix test/api/test build.
2009-03-08 17:06:55 +00:00
Dave Wysochanski
227301e041 Move lvm.h from lib to liblvm. 2009-03-06 22:49:48 +00:00
Dave Wysochanski
e0c64c6c35 Add new liblvm build directory and move lvm_base.c.
The original liblvm.a has been moved to liblvm-internal.a.
We now use liblvm.a for the new application library and build
it inside liblvm directory.

Change dependencies so tools depend on liblvm application library,
and application library depends on liblvm internal.
2009-03-06 16:19:52 +00:00