]> sourceware.org Git - lvm2.git/log
lvm2.git
13 years agoAdd missing \0 for grown debug object
Zdenek Kabelac [Mon, 14 Mar 2011 17:00:57 +0000 (17:00 +0000)]
Add missing \0 for grown debug object

Attach \0 for proper char* display - otherwise somewhat random message could
be displayed in debug more and read of unpredictable read of uninitilized
memory values could happen.

13 years agoRevert this commit
Zdenek Kabelac [Sun, 13 Mar 2011 23:18:30 +0000 (23:18 +0000)]
Revert this commit

This buffer allocation must have been problem somewhere else.
(as sizeof() already has the 'extra' '\0' included).
For now reverting this commit.

13 years agoFix allocation of system_id
Zdenek Kabelac [Sun, 13 Mar 2011 23:05:48 +0000 (23:05 +0000)]
Fix allocation of system_id

As code uses strncpy(system_id, NAME_LEN) and doesn't set '\0'
Fix it by always allocating NAME_LEN + 1 buffer size and with zalloc
we always get '\0' as the last byte.

This bug may trigger some unexpected behavior of the string operation
code - depends on the pool allocator.

FIXME: refactor this code to alloc_vg.

13 years agoUse proper size of strncpy
Zdenek Kabelac [Sun, 13 Mar 2011 23:01:08 +0000 (23:01 +0000)]
Use proper size of strncpy

Avoid reading extra character if we expect to have there '\0'.

13 years agoFix buffer allocation size for uuid string
Zdenek Kabelac [Sun, 13 Mar 2011 22:57:51 +0000 (22:57 +0000)]
Fix buffer allocation size for uuid string

We have 3 components and traling '\0' so allocate proper room for all of them.
Problem was nicely hidden by allocation from pool and allocation aligment
offset - so to trigger real problem with this one is actually hard.

13 years agoFix usage of readlink
Zdenek Kabelac [Sun, 13 Mar 2011 22:52:16 +0000 (22:52 +0000)]
Fix usage of readlink

Return value of readlink limits valid string size.
Characters after returned size present some garbage to printf.
Fix it by placing '\0' on the return size value.

13 years agoRemove compile warning for lock_id.
Peter Rajnoha [Sun, 13 Mar 2011 18:08:26 +0000 (18:08 +0000)]
Remove compile warning for lock_id.

%llx --> PRIx64

13 years agolv_status_r now prints out status of attached log LVs
Jonathan Earl Brassow [Fri, 11 Mar 2011 22:25:36 +0000 (22:25 +0000)]
lv_status_r now prints out status of attached log LVs

(Print layout could be nicer... :(

13 years agolv_status_r has been fixed-up so that it supports infinite LV stacking
Jonathan Earl Brassow [Fri, 11 Mar 2011 22:16:38 +0000 (22:16 +0000)]
lv_status_r has been fixed-up so that it supports infinite LV stacking

(It does not yet follow 'log_lv' or 'origin' links.)

13 years agodetect RAID* LV and segment flags.
Jonathan Earl Brassow [Fri, 11 Mar 2011 18:22:39 +0000 (18:22 +0000)]
detect RAID* LV and segment flags.

13 years agoUse format instance mempool where possible and adequate.
Peter Rajnoha [Fri, 11 Mar 2011 15:10:16 +0000 (15:10 +0000)]
Use format instance mempool where possible and adequate.

13 years agoVarious cleanups for fid mem and ref_count changes.
Peter Rajnoha [Fri, 11 Mar 2011 15:08:31 +0000 (15:08 +0000)]
Various cleanups for fid mem and ref_count changes.

Missing free_vg on error_path in lvmcache_get_vg fn. Call destroy_instance
only if the fid is not part of the vg in backup_read_vg fn (otherwise it's
part of the VG we're returning and we definitely don't want to destroy it!).

13 years agoCall destroy_instance for any PVs found in VG structure during vg_free call.
Peter Rajnoha [Fri, 11 Mar 2011 15:06:13 +0000 (15:06 +0000)]
Call destroy_instance for any PVs found in VG structure during vg_free call.

This is necessary for proper format instance ref_count support. We iterate
over vg->pvs and vg->removed_pvs list and the ref_count is decremented and
then it is destroyed if not referenced anymore.

13 years agoAdd new free_pv_fid fn and use it throughout to free all attached fids.
Peter Rajnoha [Fri, 11 Mar 2011 14:56:56 +0000 (14:56 +0000)]
Add new free_pv_fid fn and use it throughout to free all attached fids.

Since format instances will use own memory pool, it's necessary to properly
deallocate it. For now, only fid is deallocated. The PV structure itself
still uses cmd mempool mostly, but anytime we'd like to add a mempool
in the struct physical_volume, we can just rename this fn to free_pv and
add the code (like we have free_vg fn for VGs).

13 years agoUse only vg_set_fid and new pv_set_fid fn to assign the format instance.
Peter Rajnoha [Fri, 11 Mar 2011 14:50:13 +0000 (14:50 +0000)]
Use only vg_set_fid and new pv_set_fid fn to assign the format instance.

This is essential for proper format instance ref_count support. We must
use these functions to set the fid everywhere from now on, even the NULL
value!

13 years agoMake create_text_context fn static and move it inside create_instance fn.
Peter Rajnoha [Fri, 11 Mar 2011 14:45:17 +0000 (14:45 +0000)]
Make create_text_context fn static and move it inside create_instance fn.

We'd like to use the fid mempool for text_context that is stored
in the instance (we used cmd mempool before, so the order of
initialisation was not a matter, but now it is since we need to
create the fid mempool first which happens in create_instance fn).

The text_context initialisation is not needed anywhere outside the
create_instance fn so move it there.

13 years agoAdd mem and ref_count fields to struct format_instance for own mempool use.
Peter Rajnoha [Fri, 11 Mar 2011 14:38:38 +0000 (14:38 +0000)]
Add mem and ref_count fields to struct format_instance for own mempool use.

Format instances can be created anytime on demand and it contains
metadata area information mostly (at least for now, but in the future,
we may store more things here to update/edit in a PV/VG). In case we
have lots of metadata areas, memory consumption will rise. Using cmd
context mempool is not quite optimal here because it is destroyed too
late. So let's use a separate mempool for format instances.

Reference counting is used because fids could be shared, e.g. each PV
has either a PV-based fid or VG-based fid. If it's VG-based, each PV has
a shared fid with the VG - a reference to VG's fid.

13 years agoUse new alloc_fid fn for common format instance initialisation.
Peter Rajnoha [Fri, 11 Mar 2011 14:30:27 +0000 (14:30 +0000)]
Use new alloc_fid fn for common format instance initialisation.

13 years agoMissed merge fix in vg_validate patch
Zdenek Kabelac [Thu, 10 Mar 2011 22:39:36 +0000 (22:39 +0000)]
Missed merge fix in vg_validate patch

13 years agoDocument pv_min_size in lvm.conf manpage
Zdenek Kabelac [Thu, 10 Mar 2011 15:20:10 +0000 (15:20 +0000)]
Document pv_min_size in lvm.conf manpage

13 years agoOptimise _eat_space and _get_token
Zdenek Kabelac [Thu, 10 Mar 2011 14:51:35 +0000 (14:51 +0000)]
Optimise _eat_space and _get_token

Makes the code more readable and has a smaller number of memory
accesses thus it's small optimisation as well.

For _get_token() optimize number parsing. Check for '.' char only
if it's not a digit. Move pointer incrementation into one place.

For _eat_space() check only p->te for '\0' in skipping of comment line.
Avoid check for '\0' when we know it is space. Also master while loop
doesn't need checking p->tb for '\0'. We just need to check p->tb
isn't already at the end of buffer. This could give 'extra' loop cycle
if we are already there - but safes memory access in every other case.

13 years agoKeep pool name also for pool-fast
Zdenek Kabelac [Thu, 10 Mar 2011 14:49:01 +0000 (14:49 +0000)]
Keep pool name also for pool-fast

It's cheap to keep this name - and it is useful for 'non pool debug code'
compilation.

13 years agoIndent spaces to tabs
Zdenek Kabelac [Thu, 10 Mar 2011 14:47:22 +0000 (14:47 +0000)]
Indent spaces to tabs

13 years agoRefactor code for _lv_postoder
Zdenek Kabelac [Thu, 10 Mar 2011 14:40:32 +0000 (14:40 +0000)]
Refactor code for _lv_postoder

Add _lv_postorder_vg() - for calling _lv_postorder() for every LV from VG.
We use this in 2 places -  vg_mark_partial_lvs() and vg_validate()
so make it as a one function.

Benefit here is - to use only one cleanup code and avoid
potentially duplicate scans of same LVs.

13 years agogdbinit - A GDB init file to help while debugging LVM.
Jonathan Earl Brassow [Thu, 10 Mar 2011 13:45:12 +0000 (13:45 +0000)]
gdbinit - A GDB init file to help while debugging LVM.

Copy this file as '.gdbinit' to your home directory or your working
directory.  It adds the following commands to gdb:
 - first_seg
 - lv_status
 - lv_status_r
 - lv_is_mirrored
 - seg_item
 - seg_status
 - segs_using_this_lv

You can get a list of these user-defined commands by typing:
(gdb) help user-defined

You can get more information on each command by typing:
(gdb) help <command>

13 years agoUse hash tables for validating names
Zdenek Kabelac [Thu, 10 Mar 2011 13:11:59 +0000 (13:11 +0000)]
Use hash tables for validating names

Accelerate validation loop by using lvname, lvid, pvid hash tables.
Also merge pvl loop into one cycle now - no need to scan the list twice.
List scan is stopped when dm_hash_insert fails.

The error message with loop_counter1 is no longer provided - however
the message has been misleading anyway.

13 years agoFix dmsetup man page typo (John Bradshaw)
Milan Broz [Thu, 10 Mar 2011 13:11:45 +0000 (13:11 +0000)]
Fix dmsetup man page typo (John Bradshaw)

13 years agoUse void pointer instead of char for binary key
Zdenek Kabelac [Thu, 10 Mar 2011 12:48:40 +0000 (12:48 +0000)]
Use void pointer instead of char for binary key

dm_hash binary functions takes void* key - so there is no need to cast
pointers to char* (also the hash key does not have trailing '\0').

This is slight API change, but presents no change for the API user side
it just allows to write code easier as the casting could be removed.

13 years agoRefactor vg allocation code
Zdenek Kabelac [Thu, 10 Mar 2011 12:43:29 +0000 (12:43 +0000)]
Refactor vg allocation code

Create new function alloc_vg() to allocate VG structure.

It takes pool_name (for easier debugging).
and also take vg_name to futher simplify code.

Move remainder of _build_vg_from_pds  to _pool_vg_read
and use vg memory pool for import functions.
(it's been using smem -> fid mempool -> cmd mempool)
(FIXME: remove mempool parameter for import functions and use vg).

Move remainder of the _build_vg to _format1_vg_read

13 years agoAvoid possible endless loop in _free_vginfo when 4 or more VGs have same name.
Alasdair Kergon [Thu, 10 Mar 2011 03:03:03 +0000 (03:03 +0000)]
Avoid possible endless loop in _free_vginfo when 4 or more VGs have same name.

13 years agoUse empty string instead of /dev// for LV path when there's no VG.
Alasdair Kergon [Wed, 9 Mar 2011 12:44:42 +0000 (12:44 +0000)]
Use empty string instead of /dev// for LV path when there's no VG.
Don't allocate unused VG mempool in _pvsegs_sub_single.

13 years agoDo not send random bytes in message
Zdenek Kabelac [Tue, 8 Mar 2011 22:48:50 +0000 (22:48 +0000)]
Do not send random bytes in message

Fixing few issues:

struct clvm_header  contains  'char args[1]' - so adding '+ 1' here
for message length calculation is 1 byte off.
Message with last byte uninitialized is then passed to write function.
Update also related arglen.

Initialise xid and clintid to 0.

Memory allocation is checked for NULL

13 years agoFix reading byte from char params[-1] position
Zdenek Kabelac [Tue, 8 Mar 2011 22:43:19 +0000 (22:43 +0000)]
Fix reading byte from char params[-1] position

When the ->params string is empty - memory access is made on the byte
before allocated buffer (catched by valgrind) - in the case it would
constain 0x20 - it would even overwrite this buffer.
So fix by checking len > 0 before doing such access.
Also slightly optimise this loop from repeated strlen call.

13 years agoFix clvmd return code for bad options.
Milan Broz [Tue, 8 Mar 2011 13:27:39 +0000 (13:27 +0000)]
Fix clvmd return code for bad options.

We should return exit code 2 for unknown option.

Patch also adds standard --help option instead.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=666991

13 years agoFix test for 8k page (fails on Sparc architecture).
Milan Broz [Sun, 6 Mar 2011 18:28:09 +0000 (18:28 +0000)]
Fix test for 8k page (fails on Sparc architecture).

13 years agoUse lvm_getpagesize wrapper
Zdenek Kabelac [Sun, 6 Mar 2011 17:52:07 +0000 (17:52 +0000)]
Use lvm_getpagesize wrapper

13 years agoFix hardcoded page size, fixing test fails with 8k page and new kernel.
Milan Broz [Sun, 6 Mar 2011 16:47:43 +0000 (16:47 +0000)]
Fix hardcoded page size, fixing test fails with 8k page and new kernel.

13 years agoMove secure flag warning to verbose level.
Milan Broz [Sat, 5 Mar 2011 21:17:19 +0000 (21:17 +0000)]
Move secure flag warning to verbose level.

This feature is not yet upstream and becuase cryptsetup in next version
uses this flag, it will cause a lot of noise on old kernels.

13 years agoFix reading of released memory
Zdenek Kabelac [Sat, 5 Mar 2011 12:14:00 +0000 (12:14 +0000)]
Fix reading of released memory

lvseg_segtype_dup used memory pool vg memory pool for strind duplication.
However this one gets released before reporting happens so the command like:

pvs -o segtype

prints data from already released memory pool. Thanks to the fact there
is not much allocation happing after the VG is released, the memory
stays unmodified and correct result is printed.

Fix adds support for mempool passed parameter (like other similar
query commands) and uses dm_report memory pool for string duplication.

13 years agoMake the lock test a little bit better...
Milan Broz [Fri, 4 Mar 2011 15:04:08 +0000 (15:04 +0000)]
Make the lock test a little bit better...

13 years agoWait until dmeventd properly starts in test.
Milan Broz [Fri, 4 Mar 2011 14:19:18 +0000 (14:19 +0000)]
Wait until dmeventd properly starts in test.

13 years agoLeave some time to scheduler
Zdenek Kabelac [Thu, 3 Mar 2011 16:04:53 +0000 (16:04 +0000)]
Leave some time to scheduler

Looks like scheduler prefers running task before exiting tasks.
So leave some time to finish running flock process.

13 years agoAvoid using pipes on lv commands
Zdenek Kabelac [Thu, 3 Mar 2011 15:46:05 +0000 (15:46 +0000)]
Avoid using pipes on lv commands

Failure on pipe kills lv command and produces memory stacktrace.
Add 'true' for empty grep/sed to avoid generating stacktrace.

This should help with long time (7min) for this test on Lenny testing maching
(mimage was filler with stacktrace and each word was used as LV name).

13 years agoFix test, "echo n" is not needed when -y is specified.
Milan Broz [Thu, 3 Mar 2011 14:16:08 +0000 (14:16 +0000)]
Fix test, "echo n" is not needed when -y is specified.

13 years agoLower severity of selabel_lookup and matchpathcon failure to log_debug.
Peter Rajnoha [Thu, 3 Mar 2011 13:05:40 +0000 (13:05 +0000)]
Lower severity of selabel_lookup and matchpathcon failure to log_debug.

13 years agoDo not echo y to lvconvert
Zdenek Kabelac [Thu, 3 Mar 2011 12:30:33 +0000 (12:30 +0000)]
Do not echo y to lvconvert

This lvconvert is now able to complete operation automatically without question.
So remove  'echo y |'  - it's breaking pipe on some bash versions.

i.e.:
+ echo y
./t-lvconvert-mirror-basic.sh: line 104: echo: write error: Broken pipe

while command has completed this operation succesfully

13 years agoFix syslog initialisation in clvmd to respect lvm.conf setting.
Milan Broz [Wed, 2 Mar 2011 23:38:22 +0000 (23:38 +0000)]
Fix syslog initialisation in clvmd to respect lvm.conf setting.

13 years agoIncrease check timeout again.
Milan Broz [Wed, 2 Mar 2011 20:14:39 +0000 (20:14 +0000)]
Increase check timeout again.

It fails on my s390x Hercules emulator otherwise. :)

13 years agoPE size overflows, on most architectures it is catch by "PE cannot be 0"
Milan Broz [Wed, 2 Mar 2011 20:00:09 +0000 (20:00 +0000)]
PE size overflows, on most architectures it is catch by "PE cannot be 0"
but s390x unfortunately return something usable.

Always use unit64 in inital parameter check.

13 years agoUse 64bit unsigned value for maximum stripe size test.
Milan Broz [Wed, 2 Mar 2011 16:56:06 +0000 (16:56 +0000)]
Use 64bit unsigned value for maximum stripe size test.

While STRIPE_SIZE_LIMIT * 2 is basically UINT_MAX, 32bit integer
value can already overflow durin arg size parsing.

(This really happens in test where --stripesize 4294967291 is used,
in s390x uint overflow and this test is ineffective.)

13 years agoDo not run past the end of an array in dmeventd's _handle_request when faced
Petr Rockai [Wed, 2 Mar 2011 14:20:48 +0000 (14:20 +0000)]
Do not run past the end of an array in dmeventd's _handle_request when faced
with an unknown command ID.

13 years agoFix test to use explicit /dev/mapper/ node, /proc/mounts should not change this...
Milan Broz [Wed, 2 Mar 2011 13:49:29 +0000 (13:49 +0000)]
Fix test to use explicit /dev/mapper/ node, /proc/mounts should not change this...
(failed on RHEL5)

13 years agoAs requested in BZ 454618:
Petr Rockai [Wed, 2 Mar 2011 12:49:13 +0000 (12:49 +0000)]
As requested in BZ 454618:
- dmeventd -R will continue to start up even if no dmeventd is currently
  running + a test for this behaviour
- add -R to dmeventd manpage

13 years agoUse a copy if moving an mda from pv fid to vg fid.
Peter Rajnoha [Wed, 2 Mar 2011 10:23:29 +0000 (10:23 +0000)]
Use a copy if moving an mda from pv fid to vg fid.

We'll destroy the pv fid (with all mdas in it) after merging all pv mdas to
a vg in _text_pv_setup fn, hence we need to use a copy here!

13 years agoMake add_metadata_area_to_pv/remove_metadata_area_from_pv static.
Peter Rajnoha [Wed, 2 Mar 2011 10:19:14 +0000 (10:19 +0000)]
Make add_metadata_area_to_pv/remove_metadata_area_from_pv static.

No need to put these in format-text.h, it's not used anywhere else actually.

13 years agoIndent case part properly
Zdenek Kabelac [Wed, 2 Mar 2011 08:41:55 +0000 (08:41 +0000)]
Indent case part properly

13 years agoAdd missing return
Zdenek Kabelac [Wed, 2 Mar 2011 08:40:28 +0000 (08:40 +0000)]
Add missing return

13 years agoAccept multiple mapped device names on many dmsetup command lines.
Alasdair Kergon [Wed, 2 Mar 2011 02:44:56 +0000 (02:44 +0000)]
Accept multiple mapped device names on many dmsetup command lines.

13 years agoFix dm_udev_wait calls in dmsetup to occur before readahead display not after.
Alasdair Kergon [Wed, 2 Mar 2011 00:29:57 +0000 (00:29 +0000)]
Fix dm_udev_wait calls in dmsetup to occur before readahead display not after.
Include an implicit dm_task_update_nodes() within dm_udev_wait().

13 years agoRather return success if skipping udev wait.
Milan Broz [Tue, 1 Mar 2011 23:44:07 +0000 (23:44 +0000)]
Rather return success if skipping udev wait.

13 years agoInvert condition for READLINE check
Zdenek Kabelac [Tue, 1 Mar 2011 23:29:14 +0000 (23:29 +0000)]
Invert condition for READLINE check

13 years agoFix _create_and_load_v4 not to lose the --addnodeoncreate setting (1.02.62).
Alasdair Kergon [Tue, 1 Mar 2011 23:27:06 +0000 (23:27 +0000)]
Fix _create_and_load_v4 not to lose the --addnodeoncreate setting (1.02.62).

13 years agoBuild test.c also without readline library
Zdenek Kabelac [Tue, 1 Mar 2011 23:18:40 +0000 (23:18 +0000)]
Build test.c also without readline library

Allow bulding of this testing tool also without readline library.
Outputs message about build without readline library then.

13 years agoFix tests if udevadm missing (old udev).
Milan Broz [Tue, 1 Mar 2011 22:28:27 +0000 (22:28 +0000)]
Fix tests if udevadm missing (old udev).

13 years agoQuick fix to compile lvm2api tests when possible
Zdenek Kabelac [Tue, 1 Mar 2011 21:30:43 +0000 (21:30 +0000)]
Quick fix to compile lvm2api tests when possible

Do not build lvm2api tests when lvm2api lib is not enabled.

13 years agoFix some compile warnings on RHEL5
Milan Broz [Tue, 1 Mar 2011 20:17:56 +0000 (20:17 +0000)]
Fix some compile warnings on RHEL5
- returned char not needed to be explicitly const
- warn if pipe() fails in clvmd (more fixes here needed for error paths...)
- assign (and ignore) read() output in drain buffer

13 years agoRephrase backup message.
Milan Broz [Mon, 28 Feb 2011 20:50:01 +0000 (20:50 +0000)]
Rephrase backup message.

13 years agoFix void pointer arithmetic warning in pool debug code
Zdenek Kabelac [Mon, 28 Feb 2011 19:54:30 +0000 (19:54 +0000)]
Fix void pointer arithmetic warning in pool debug code

13 years agoAdd fall through comments
Zdenek Kabelac [Mon, 28 Feb 2011 19:53:03 +0000 (19:53 +0000)]
Add fall through comments

Add comments to switch case construct.

13 years agoRemove dead code
Zdenek Kabelac [Mon, 28 Feb 2011 19:50:15 +0000 (19:50 +0000)]
Remove dead code

Remove code which is no longer used.
Code which has been using msg_malloced was removed in 2007.

13 years agoTest result of dm_task_set_uuid
Zdenek Kabelac [Mon, 28 Feb 2011 19:47:22 +0000 (19:47 +0000)]
Test result of dm_task_set_uuid

13 years agoUse backward compatible configuration for test
Zdenek Kabelac [Mon, 28 Feb 2011 19:44:21 +0000 (19:44 +0000)]
Use backward compatible configuration for test

Currently the test are not properly working with new code.
Use settings for the previous behaviour.

FIXME: update tests to properly test new allocation policies.

13 years agomention vgreduce in pvremove man page
Alasdair Kergon [Mon, 28 Feb 2011 19:40:04 +0000 (19:40 +0000)]
mention vgreduce in pvremove man page

13 years agoImprove pvremove error message when PV belongs to a VG.
Alasdair Kergon [Mon, 28 Feb 2011 19:35:09 +0000 (19:35 +0000)]
Improve pvremove error message when PV belongs to a VG.

13 years agoAdd a hint for manual revert if there's an error in pv_write, vg_write, vg_commit...
Peter Rajnoha [Mon, 28 Feb 2011 17:08:09 +0000 (17:08 +0000)]
Add a hint for manual revert if there's an error in pv_write, vg_write, vg_commit for pvresize.

13 years agoUse pv->vg_name directly instead of pv->vg->name in _text_pv_write.
Peter Rajnoha [Mon, 28 Feb 2011 17:05:48 +0000 (17:05 +0000)]
Use pv->vg_name directly instead of pv->vg->name in _text_pv_write.

This also prevents a possible segfault during an automatic repair
when the PV does not belong to a VG anymore and we call pv_write_orphan.

13 years agoAllow non-orphan PVs with two metadata areas to be resized.
Peter Rajnoha [Mon, 28 Feb 2011 13:19:02 +0000 (13:19 +0000)]
Allow non-orphan PVs with two metadata areas to be resized.

We allow writing non-orphan PVs only for resize now. The "orphan PV" assert
in pv_write fn uses the "allow_non_orphan" parameter to control this assert.
However, we should find a more elaborate solution so we can remove this
restriction altogether (pv_write together with vg_write is not atomic, we
need to find a safe mechanism so there's an easy revert possible in case of
an error).

13 years agoFix check for log-only allocation in new alloc normal loop.
Alasdair Kergon [Sun, 27 Feb 2011 01:16:52 +0000 (01:16 +0000)]
Fix check for log-only allocation in new alloc normal loop.

13 years agoVarious changes to the allocation algorithms: Expect some fallout.
Alasdair Kergon [Sun, 27 Feb 2011 00:38:31 +0000 (00:38 +0000)]
Various changes to the allocation algorithms: Expect some fallout.
There is a lot to test.

Two new config settings added that are intended to make the code behave
closely to the way it did before - worth a try if you find problems.

13 years agovgconvert is fixed now to work with the changes in metadata area handling - enable...
Peter Rajnoha [Fri, 25 Feb 2011 14:12:14 +0000 (14:12 +0000)]
vgconvert is fixed now to work with the changes in metadata area handling - enable the tests.
Add a small fix that preserves pe_start for lvm1 PVs when being converted.

(this fix needs to be replaced with something more clever, but let's have this working now)

13 years agoAllow only orphan PVs to be resized even with two metadata areas.
Peter Rajnoha [Fri, 25 Feb 2011 14:08:54 +0000 (14:08 +0000)]
Allow only orphan PVs to be resized even with two metadata areas.

13 years agoRevert the patch for vgconvert to work with recent changes in metadata area handling.
Peter Rajnoha [Fri, 25 Feb 2011 14:02:53 +0000 (14:02 +0000)]
Revert the patch for vgconvert to work with recent changes in metadata area handling.

This should work now with the help of the patch from previous commit.

13 years agoRead PV metadata information from cache if pv_setup called with pv->fid == vg->fid.
Peter Rajnoha [Fri, 25 Feb 2011 13:59:47 +0000 (13:59 +0000)]
Read PV metadata information from cache if pv_setup called with pv->fid == vg->fid.

If the PV is already part of the VG (so the pv->fid == vg->fid), it makes no
sense to attach the mdas information from PV to a VG. Instead, we read new
PV metadata information from cache and attach it to the VG fid.

13 years agoFix a bug in metadata location calculation, cleanup pv_add_metadata_area fn.
Peter Rajnoha [Fri, 25 Feb 2011 13:50:02 +0000 (13:50 +0000)]
Fix a bug in metadata location calculation, cleanup pv_add_metadata_area fn.

This bug (a missing line) caused the 2nd MDA area location to be calculated
incorrectly and it didn't fit the disk size properly.

(https://www.redhat.com/archives/lvm-devel/2011-February/msg00127.html)

13 years agoRemove a few size_t type warnings.
Peter Rajnoha [Tue, 22 Feb 2011 10:01:11 +0000 (10:01 +0000)]
Remove a few size_t type warnings.

13 years agoAdd inactive table query support for kernel driver >= 4.11.6 (RHEL 5.7).
Mike Snitzer [Mon, 21 Feb 2011 16:26:23 +0000 (16:26 +0000)]
Add inactive table query support for kernel driver >= 4.11.6 (RHEL 5.7).

13 years ago%ld -> PRIu64
Peter Rajnoha [Mon, 21 Feb 2011 13:09:27 +0000 (13:09 +0000)]
%ld -> PRIu64

13 years agoWHATS_NEW
Peter Rajnoha [Mon, 21 Feb 2011 12:40:46 +0000 (12:40 +0000)]
WHATS_NEW

13 years agoTemporarily disable 'convert a VG from lvm2 to lvm1 format' test until a known issue...
Peter Rajnoha [Mon, 21 Feb 2011 12:37:33 +0000 (12:37 +0000)]
Temporarily disable 'convert a VG from lvm2 to lvm1 format' test until a known issue is resolved.

Otherwise we get an error:

  PV segment VG free_count mismatch: 32 != 33
  PV segment VG extent_count mismatch: 32 != 33

13 years agoFix metadata balance code to work with recent changes in metadata handling
Peter Rajnoha [Mon, 21 Feb 2011 12:33:16 +0000 (12:33 +0000)]
Fix metadata balance code to work with recent changes in metadata handling
interface (with the changes in format_instance).

13 years agoAdd old_uuid field to struct physical_volume so we can still reference a PV
Peter Rajnoha [Mon, 21 Feb 2011 12:31:28 +0000 (12:31 +0000)]
Add old_uuid field to struct physical_volume so we can still reference a PV
with its old UUID when we're changig it (the cache as well as metadata area
index has the old uuid that we need to use to access the information!)

13 years agoFix vgconvert code to work with changes in metadata area handling and changes
Peter Rajnoha [Mon, 21 Feb 2011 12:29:21 +0000 (12:29 +0000)]
Fix vgconvert code to work with changes in metadata area handling and changes
in format_instance. Add new 'vg_convert' function.

13 years agoChange pvresize code to work with new metadata handling interface and allow
Peter Rajnoha [Mon, 21 Feb 2011 12:27:26 +0000 (12:27 +0000)]
Change pvresize code to work with new metadata handling interface and allow
resizing a PV with two metadata areas.

13 years agoChange pv_write code to work with the changes in metadata handling interface
Peter Rajnoha [Mon, 21 Feb 2011 12:26:27 +0000 (12:26 +0000)]
Change pv_write code to work with the changes in metadata handling interface
and changes in format_instance.

13 years agoRemove unused _mda_setup fn. This functionality is covered by new pv_add_metadata_are...
Peter Rajnoha [Mon, 21 Feb 2011 12:25:16 +0000 (12:25 +0000)]
Remove unused _mda_setup fn. This functionality is covered by new pv_add_metadata_area fn.

13 years agoChange the code throughout to use new pv_initialise and modified pv_setup fn.
Peter Rajnoha [Mon, 21 Feb 2011 12:24:15 +0000 (12:24 +0000)]
Change the code throughout to use new pv_initialise and modified pv_setup fn.
Change pv_create code to work with these changes together with using new
pv_add_metadata_area fn to add metadata areas for a PV being created.

13 years agoSeparate new pv_initialise function out of the original pv_setup code.
Peter Rajnoha [Mon, 21 Feb 2011 12:20:18 +0000 (12:20 +0000)]
Separate new pv_initialise function out of the original pv_setup code.

pv_initiliase initialises a new PV
pv_setup sets up an existing PV with a VG

13 years agoAdd new pv_remove_metadata_area interface function.
Peter Rajnoha [Mon, 21 Feb 2011 12:17:54 +0000 (12:17 +0000)]
Add new pv_remove_metadata_area interface function.

13 years agoAdd new pv_add_metadata_area interface function.
Peter Rajnoha [Mon, 21 Feb 2011 12:17:26 +0000 (12:17 +0000)]
Add new pv_add_metadata_area interface function.

13 years agoRemove useless mdas parameter for pv_read (from now on, we store mdas in a
Peter Rajnoha [Mon, 21 Feb 2011 12:15:59 +0000 (12:15 +0000)]
Remove useless mdas parameter for pv_read (from now on, we store mdas in a
format instance)

This page took 0.064803 seconds and 5 git commands to generate.