1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-25 01:34:38 +03:00
Commit Graph

6177 Commits

Author SHA1 Message Date
Zdenek Kabelac
4961eeba52 Check if lp.origin exists
Currently needed for _determine_snapshot_type().
2011-09-07 09:25:51 +00:00
Zdenek Kabelac
58da345e4e Improve man page style
Only reformat man pages.
2011-09-07 08:50:35 +00:00
Zdenek Kabelac
8ff2e245ac Support break for vgchange and vgrefresh operation
Allow to break some lengthy vgchange and vgrefresh operation.
2011-09-07 08:41:47 +00:00
Zdenek Kabelac
83ca5e6d5c Remove unused passed parameters 2011-09-07 08:37:48 +00:00
Zdenek Kabelac
d05c996d48 Minor change for pv_create api
Switch int to unsigned type.
2011-09-07 08:34:21 +00:00
Zdenek Kabelac
867e4cfffb Replace char class :space: with explicit chars
Some major distributions are still using 'mawk' and they are not using
the latest version - we end here with hidden dependency on the latest
version of mawk (1.3.4) while i.e. Debian Lenny seems to stay with 1.3.3.
So we end with completely broken  vgimportclone script on such system.

We would need to check for proper support of :space: and abort build if
it doesn't work or simplier replace [:space:] with [ \t] which seems
sufficient to make it work (as can be seen in this patch)

A better fix would be to use command line parameter override - leaving
as FIXME comment.

This patch makes t-vgimportclone.sh test passing on Lenny.
2011-09-07 08:31:16 +00:00
Alasdair Kergon
10ab5428df pool attach fns & more field renaming 2011-09-06 22:43:56 +00:00
Zdenek Kabelac
704cb6b4e9 Convert data->pool 2011-09-06 22:35:44 +00:00
Alasdair Kergon
c455c4c1d9 add thin_manip.c like the other manip files
move basic lv_is_* to macros
data_lv -> pool_lv - we decided to call it 'pool' everywhere now
2011-09-06 19:25:42 +00:00
Alasdair Kergon
d19192b20e Start using 64-bit status flags - most of the code already handles them.
tdata -> tpool
remove commented out definitions from metadata.h
formatting clean-ups
2011-09-06 18:49:31 +00:00
Zdenek Kabelac
054c6c890a Detect sscanf recovering_region input error
Missing check for sscanf found by static analyzer.
2011-09-06 18:24:27 +00:00
Zdenek Kabelac
ebb39e1041 Fix memory leak of allocated bitmap in error path
Found by static analyzer.
2011-09-06 18:15:43 +00:00
Zdenek Kabelac
c5120c1a7a Log unlink() error 2011-09-06 18:11:21 +00:00
Alasdair Kergon
0de26cd346 else 2011-09-06 15:39:46 +00:00
Alasdair Kergon
77729280f6 tdata->tpool 2011-09-06 15:38:44 +00:00
Alasdair Kergon
f5a8f2d2ca only thin volumes need converting 2011-09-06 15:35:11 +00:00
Alasdair Kergon
e4b64bf719 lvcreate parsing for thin provisioning.
The rest is incomplete so this isn't usable yet.
2011-09-06 00:26:42 +00:00
Alasdair Kergon
096dbb58f9 Remove incorrect requirement for -j or -m from lvchange error message. 2011-09-05 12:54:29 +00:00
Zdenek Kabelac
0b13efd7e5 Hack for build rules of lvmetad
FIXME
2011-09-02 14:49:00 +00:00
Zdenek Kabelac
d522fa71f0 Add missing 'static' for local function
Avoid missing prototype warning.
2011-09-02 12:38:43 +00:00
Zdenek Kabelac
ccc01ce94b Compile fix
Reflecting change in dm_config_value  float r -> float f.
2011-09-02 11:04:12 +00:00
Alasdair Kergon
0031b78938 temp notes on dealing with cascade 2011-09-02 01:59:07 +00:00
Alasdair Kergon
5c216d6eb2 Move cascade inside libdm etc.
Makes dumpconfig whole-section output wrong in a different way from before,
but we should be able to merge cft_cmdline properly into cmd->cft now and
remove cascade.
2011-09-02 01:32:08 +00:00
Alasdair Kergon
c147bbddb3 Comments, FIXMEs, name changes. 2011-09-01 21:04:14 +00:00
Jonathan Earl Brassow
985a6a65cb Updates to gdbinit file
1) Add more status flags for printing
2) Fix bug in lv_status_r processing for mirror segment type
2011-09-01 21:01:12 +00:00
Jonathan Earl Brassow
9ab111abc0 Fix for bug 732142: Unsafe table load during mirror image split
There was a bad sequence:
*) Make changes to LV layout to split images (e.g. 4-way -> 2-way/2-way)
1) vg_write, suspend_lv(original_mirror), vg_commit
2) activate_lv(newly_split_lv)
3) resume_lv(original_mirror)

Step #2 is not allowed.  However, without it, the resume of the original
mirror will also resume its former sub-LVs - making it impossible to
activate the newly split LV due to the changes in layering, pointers, and
names that had already been made.  Additionally, the resume or the original
brings the sub-lv's online with names that differ from the metadata on disk -
also a no-no.  Thus, the split must be done in stages such that the active LVs
always reflect what is in the committed LVM metadata.

First, alter the original mirror by releasing the images.  The images are made
visible and independent as an intermediate stage.  (This way, we can have
consistency between LVM metadata and active LVs.)  The second stage collects
the recently split LVs, deactivates them, forms them into a mirror if necessary,
and then activates them.  It is a bit of a circuitous method, but it is the only
way to split a mirror from a mirror and obey these general rules:
1) Never [de]activate sub-lvs when the top-level LV is suspended
2) Avoid having active LVs that differ from the description in the LVM metadata

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
2011-09-01 19:22:11 +00:00
Alasdair Kergon
eced331945 Add comments & remove always-included header. 2011-09-01 17:58:27 +00:00
Alasdair Kergon
6f6b2cdc52 Only build libdaemon.a when we need it at the moment. 2011-09-01 17:56:53 +00:00
Zdenek Kabelac
d91c270d1c Use const casting when it's needed
Keep the lookup operation const and use const casting at the dm_ function level.
2011-09-01 14:02:05 +00:00
Zdenek Kabelac
1f5226d652 Match the prototype old-style declaration 2011-09-01 13:30:11 +00:00
Zdenek Kabelac
997dabdb9e Keep the old-style prototypes 2011-09-01 13:25:50 +00:00
Zdenek Kabelac
b90e9912f1 Use size_t return type
Since these function returns buffer size - use size_t type for them.
2011-09-01 10:25:22 +00:00
Zdenek Kabelac
fa784f6198 Mark unreleased memory pools as internal error 2011-09-01 10:19:01 +00:00
Zdenek Kabelac
066465803c Reflect dm_config API update 2011-09-01 10:16:32 +00:00
Petr Rockai
118fa896b7 Replace const usage of dm_config_find_node with more appropriate value-lookup
functionality. A number of bugs (copied and pasted all over the code) should
disappear:

- most string lookup based on dm_config_find_node would segfault when
  encountering a non-zero integer (the intention there was to print an
  error message instead)
- check for required sections in metadata would have been satisfied by
  values as well (i.e. not sections)
- encountering a section in place of expected flag value would have
  segfaulted (due to assumed but unchecked cn->v != NULL)
2011-08-31 15:19:19 +00:00
Petr Rockai
4c76c264dc Mention --enable-lvmetad in WHATS_NEW. 2011-08-31 12:47:59 +00:00
Petr Rockai
66fc323292 Do not call prepare_lvmetad just yet in tests. 2011-08-31 12:42:55 +00:00
Petr Rockai
dbe351860e Fix warnings and constness handling in lvmetad-core (adjusting the
dm_config_find_node to give non-const node pointer, since that better reflects
the contract of that function).
2011-08-31 12:39:58 +00:00
Petr Rockai
178675bec5 Fix warnings in daemons/common. 2011-08-31 12:18:40 +00:00
Petr Rockai
2254b74598 Get rid of the old lvmetad Makefile. 2011-08-31 11:44:27 +00:00
Zdenek Kabelac
26c828a598 Autoreconf for lvmetad patch 2011-08-31 11:39:32 +00:00
Petr Rockai
c4d973530f A compromise integration of LVMetaD into the build: I have kept all the
daemon/common code in a single libdaemon.a, which is completely private. This
is currently linked into the lvmetad binary, and will be linked into LVM (the
client part, since static linking only picks up only symbols that are actually
used). I have also added --enable/disable-lvmetad to ./configure; although the
current default is off, I expect this to be flipped to on shortly. There's no
LVM-side support yet, but when there is, even when built, it'll still need to
be enabled by an lvm.conf option.
2011-08-31 11:31:57 +00:00
Zdenek Kabelac
731c45ff37 Update for resource leak 2011-08-31 08:23:33 +00:00
Zdenek Kabelac
0b97ce28d6 Fix resource leak when strdup fails
Static analyzer noticed, strdup failing path leaks dmt structure.
2011-08-31 08:23:05 +00:00
Petr Rockai
51e1300519 Adapt LVMetaD to use the new dm_config interfaces. 2011-08-30 15:44:01 +00:00
Petr Rockai
5c43b9bda7 Adapt the daemon/common code to use the new dm_config interface. 2011-08-30 15:42:56 +00:00
Petr Rockai
d60c24dda8 Move the core of the lib/config/config.c functionality into libdevmapper,
leaving behind the LVM-specific parts of the code (convenience wrappers that
handle `struct device` and `struct cmd_context`, basically). A number of
functions have been renamed (in addition to getting a dm_ prefix) -- namely,
all of the config interface now has a dm_config_ prefix.
2011-08-30 14:55:15 +00:00
Peter Rajnoha
4020e6db24 Directly allocate buffer memory in a pvck scan instead of using a mempool.
There's a very high memory usage when calling _pv_analyse_mda_raw (e.g. while
executing pvck) that can end up with "out of memory".

_pv_analyse_mda_raw scans for metadata in the MDA, iteratively increasing the
size to scan with SECTOR_SIZE until we find a probable config section or we're
at the edge of the metadata area. However, when using a memory pool, we're also
iteratively chasing for bigger and bigger mempool chunk which can't be found
and so we're always allocating a new one, consuming more and more memory...

This patch just changes the mempool to direct memory allocation in this
problematic part of the code.
2011-08-29 13:37:36 +00:00
Alasdair Kergon
38c4b48f33 same for segtype_is_thin 2011-08-26 18:17:05 +00:00
Alasdair Kergon
dc2a994176 seg_is_thin includes both thin_pool and thin_volume 2011-08-26 18:15:14 +00:00