1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

5819 Commits

Author SHA1 Message Date
Alasdair Kergon
b88362ff95 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
2ef5b7cca6 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
e9047f4f9c Detect sscanf recovering_region input error
Missing check for sscanf found by static analyzer.
2011-09-06 18:24:27 +00:00
Zdenek Kabelac
b647de3e07 Fix memory leak of allocated bitmap in error path
Found by static analyzer.
2011-09-06 18:15:43 +00:00
Zdenek Kabelac
7b83071708 Log unlink() error 2011-09-06 18:11:21 +00:00
Alasdair Kergon
dd44cccefe else 2011-09-06 15:39:46 +00:00
Alasdair Kergon
afadb4628e tdata->tpool 2011-09-06 15:38:44 +00:00
Alasdair Kergon
e866a22916 only thin volumes need converting 2011-09-06 15:35:11 +00:00
Alasdair Kergon
9ac61d2ba2 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
58366c058e Remove incorrect requirement for -j or -m from lvchange error message. 2011-09-05 12:54:29 +00:00
Zdenek Kabelac
0945b313bf Hack for build rules of lvmetad
FIXME
2011-09-02 14:49:00 +00:00
Zdenek Kabelac
7aa56e8f90 Add missing 'static' for local function
Avoid missing prototype warning.
2011-09-02 12:38:43 +00:00
Zdenek Kabelac
49cd515cd2 Compile fix
Reflecting change in dm_config_value  float r -> float f.
2011-09-02 11:04:12 +00:00
Alasdair Kergon
c05144b9ec temp notes on dealing with cascade 2011-09-02 01:59:07 +00:00
Alasdair Kergon
c82c2bebed 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
fe8f5dbeb7 Comments, FIXMEs, name changes. 2011-09-01 21:04:14 +00:00
Jonathan Earl Brassow
673c8d01e6 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
da23255cc9 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
79b9c65b6b Add comments & remove always-included header. 2011-09-01 17:58:27 +00:00
Alasdair Kergon
1ca0eea5bb Only build libdaemon.a when we need it at the moment. 2011-09-01 17:56:53 +00:00
Zdenek Kabelac
441edcb50a 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
4ea01630ae Match the prototype old-style declaration 2011-09-01 13:30:11 +00:00
Zdenek Kabelac
08a95743a2 Keep the old-style prototypes 2011-09-01 13:25:50 +00:00
Zdenek Kabelac
3caa77f831 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
2d70959c86 Mark unreleased memory pools as internal error 2011-09-01 10:19:01 +00:00
Zdenek Kabelac
466098cd1c Reflect dm_config API update 2011-09-01 10:16:32 +00:00
Petr Rockai
97a4b5165e 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
c0de52fd2d Mention --enable-lvmetad in WHATS_NEW. 2011-08-31 12:47:59 +00:00
Petr Rockai
a53037f2c5 Do not call prepare_lvmetad just yet in tests. 2011-08-31 12:42:55 +00:00
Petr Rockai
e68a6fbf20 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
6e4e30827d Fix warnings in daemons/common. 2011-08-31 12:18:40 +00:00
Petr Rockai
d008fc86a0 Get rid of the old lvmetad Makefile. 2011-08-31 11:44:27 +00:00
Zdenek Kabelac
cdd508233c Autoreconf for lvmetad patch 2011-08-31 11:39:32 +00:00
Petr Rockai
615534d305 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
68e89ab2d2 Update for resource leak 2011-08-31 08:23:33 +00:00
Zdenek Kabelac
316d14d45f 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
04e647aa84 Adapt LVMetaD to use the new dm_config interfaces. 2011-08-30 15:44:01 +00:00
Petr Rockai
c033ea0170 Adapt the daemon/common code to use the new dm_config interface. 2011-08-30 15:42:56 +00:00
Petr Rockai
e59e2f7c3c 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
d35188058b 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
11bfaa1df8 same for segtype_is_thin 2011-08-26 18:17:05 +00:00
Alasdair Kergon
6fbf1c6b56 seg_is_thin includes both thin_pool and thin_volume 2011-08-26 18:15:14 +00:00
Alasdair Kergon
42914557d5 thin - hide unimplemented dso fn; remove duplicate origin_lv field; add
some lvcreate struct parms
2011-08-26 17:40:53 +00:00
Zdenek Kabelac
e82bd6249b Initial code for read/write of thin metadata lv segments 2011-08-26 13:37:47 +00:00
Zdenek Kabelac
9d32170d5c Add registration of thin_pool segment
Register thin and thin_pool segment via multiple_segtypes.
2011-08-25 10:00:09 +00:00
Alasdair Kergon
f9b92564a7 Fix raid shared lib segtype registration (2.02.87). 2011-08-24 13:41:46 +00:00
Zdenek Kabelac
3ba4a19510 Initial code layout for thin provisioning target
Only registers init_thin_segtype

Option --with-thin=internal needed for compilation.
For now useful only for developememt!
2011-08-24 08:27:49 +00:00
Alasdair Kergon
c544c6b07e . 2011-08-19 23:01:20 +00:00
Alasdair Kergon
c31d14d786 Remove incorrect error message added in 2.02.87. 2011-08-19 22:55:07 +00:00
Alasdair Kergon
2df01a9d3f post-release 2011-08-19 19:42:39 +00:00