]> sourceware.org Git - lvm2.git/log
lvm2.git
13 years agoReduce a (huge) timeout in t-mirror-names.
Petr Rockai [Wed, 20 Oct 2010 15:35:00 +0000 (15:35 +0000)]
Reduce a (huge) timeout in t-mirror-names.

13 years agoAdd a test for BZ 509182 (vgchange --monitor y breaks with max_lv).
Petr Rockai [Wed, 20 Oct 2010 15:32:15 +0000 (15:32 +0000)]
Add a test for BZ 509182 (vgchange --monitor y breaks with max_lv).

13 years agoAdd coverage test for partition table scanning
Zdenek Kabelac [Wed, 20 Oct 2010 15:14:13 +0000 (15:14 +0000)]
Add coverage test for partition table scanning

13 years agoImplement dmeventd -R, allowing dmeventd to be restarted without losing
Petr Rockai [Wed, 20 Oct 2010 15:12:12 +0000 (15:12 +0000)]
Implement dmeventd -R, allowing dmeventd to be restarted without losing
monitoring state.

13 years agoFix strict-aliasing compile warning in partition table scanning
Zdenek Kabelac [Wed, 20 Oct 2010 15:07:30 +0000 (15:07 +0000)]
Fix strict-aliasing compile warning in partition table scanning

13 years agoRevert some debug statements that slipped in with last checkin.
Petr Rockai [Wed, 20 Oct 2010 14:51:18 +0000 (14:51 +0000)]
Revert some debug statements that slipped in with last checkin.

13 years agoFix a deadlock in clvmd.
Petr Rockai [Wed, 20 Oct 2010 14:46:45 +0000 (14:46 +0000)]
Fix a deadlock in clvmd.

The signalling code (pthread_cond_signal/pthread_cond_wait) in the
pre_and_post_thread was using the wait mutex (see man pthread_cond_wait)
incorrectly, and this could cause clvmd to deadlock when timing was
right. Detailed explanation of the problem follows.

There is a single mutex around (L for Lock, U for Unlock), a signal (S) and a
wait (W). C for pthread_create. Time flows from left to right, each arrow is a
thread.

So first the "naive" scenario, with no mutex (PPT = pre_and_post_thread, MCT =
main clvmd thread; well actually the thread that does read_from_local_sock). I
will also use X, for a moment when MCT actually waits for something to happen
that PPT was supposed to do.

MCT -----C ------S--X-----S----X----------------------S------XXXXXXXXX
         |                everything OK up to this --> <-- point...
PPT       -----WWW-----WWWW------------------------------WWWWWWWWWWWWW

Ok, so pthread API actually does not let you use W/S like that. It goes out of
its way to tell you that you need a mutex to protect the W so that the above
cannot happen. *But* if you are creative and just lock around the W's and S's,
this happens:

MCT ----C-----LSU----X-----LSU----X------------LSU------XXXXXXX
        |
PPT      ---LWWWU-------LWWWWU-----------------------LWWWWWWWWW

Ooops. Nothing changed (the above is what actually was done by clvmd before
this satch). So let's do it differently, holding L locked *all* the time in
PPT, unless we are actually in W (this is something that the pthread API does
itself, see the man page).

MCT ----C-----LSU------X---LSU---X-----LLLLLLLSU----X----
        |                             (and they live happily ever after)
PPT     L---WWWWW---------WWWW----------------W----------

So W actually ensures that L is unlocked *atomically* together with entering
the wait. That means that unless PPT is actually waiting, it cannot be
signalled by MCT. So if MCT happens to signal it too soon (it wasn't waiting
yet), it (MCT) will be blocked on the mutex (L), until PPT is actually ready to
do something.

13 years agoAvoid an extraneous orphans unlock in vgextend --restoremissing.
Petr Rockai [Mon, 18 Oct 2010 17:27:10 +0000 (17:27 +0000)]
Avoid an extraneous orphans unlock in vgextend --restoremissing.

13 years agoUpdate WHATS_NEW.
Petr Rockai [Fri, 15 Oct 2010 17:04:02 +0000 (17:04 +0000)]
Update WHATS_NEW.

13 years agoImplement automatic snapshot extension with dmeventd, and add two new options
Petr Rockai [Fri, 15 Oct 2010 16:28:14 +0000 (16:28 +0000)]
Implement automatic snapshot extension with dmeventd, and add two new options
to lvm.conf in the activation section: 'snapshot_autoextend_threshold' and
'snapshot_autoextend_percent', that define how to handle automatic snapshot
extension. The former defines when the snapshot should be extended: when its
space usage exceeds this many percent. The latter defines how much extra space
should be allocated for the snapshot, in percent of its current size.

13 years agoFixes for the devices/disable_after_error_count documentation.
Petr Rockai [Fri, 15 Oct 2010 16:24:00 +0000 (16:24 +0000)]
Fixes for the devices/disable_after_error_count documentation.

13 years agoUpdate
Zdenek Kabelac [Fri, 15 Oct 2010 09:55:37 +0000 (09:55 +0000)]
Update

13 years agoSpeedup memory un/locking
Zdenek Kabelac [Fri, 15 Oct 2010 09:48:23 +0000 (09:48 +0000)]
Speedup memory un/locking

Move the call of find_config_tree_node() from inner loop to outer
section of maps scanning.

13 years agoFix linking order for liblvm2cmd
Zdenek Kabelac [Fri, 15 Oct 2010 09:41:21 +0000 (09:41 +0000)]
Fix linking order for liblvm2cmd

Reorder linked libraries so we better support --as-needed linker flag used
by some distributions (i.e. Gentoo).

Patch suggested by Diego Elio Pettenò <flameeyes <at> gmail.com>

13 years agoAdd --setuuid to dmsetup rename.
Alasdair Kergon [Fri, 15 Oct 2010 01:10:27 +0000 (01:10 +0000)]
Add --setuuid to dmsetup rename.
Add dm_task_set_newuuid to set uuid of mapped device post-creation. (pjones)

13 years agoFix for bug 637936: killing both redundant logs causes deadlock
Jonathan Earl Brassow [Thu, 14 Oct 2010 20:03:12 +0000 (20:03 +0000)]
Fix for bug 637936: killing both redundant logs causes deadlock

Problem:
When both legs of a mirrored log fail, neither the log nor the parent
mirror can proceed.  The repair code must be careful to replace the
log with an error target before operating on the parent - otherwise,
the parent can get stuck trying to suspend because it can't push through
any writes.  The steps to replace the log device with an error target
were incomplete and resulted in the replacement not happening at all!

The code originally had all the necessary logic to complete the
replacement task, but was pulled out in a effort to clean-up that
section of code, while fixing another bug:
<offending commit msg>
In addition, I added following three changes.

- Removed tmp_orphan_lvs handling procedure
  It seems that _delete_lv() can handle detached_log_lv properly
  without adding mirror legs in mirrored log to tmp_orphan_lvs.
  Therefore, I removed the procedure.

- Removed vg_write()/vg_commit()
  Metadata is saved by vg_write()/vg_commit() just after detached_log_lv
  is handled. Therefore, I removed vg_write()/vg_commit().
</offending commit msg>

http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c?cvsroot=lvm2&f=h#rev1.130

I've reverted the "clean-up" changes associated with that fix, but not what
that commit was actually fixing.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Reviewed-by: Petr Rockai <prockai@redhat.com>
13 years agoAdd a VERBOSE option to make check (make check VERBOSE=1).
Petr Rockai [Thu, 14 Oct 2010 14:36:26 +0000 (14:36 +0000)]
Add a VERBOSE option to make check (make check VERBOSE=1).

13 years agoConvey need for snapshot-merge target in lvconvert error message and man
Mike Snitzer [Wed, 13 Oct 2010 21:26:37 +0000 (21:26 +0000)]
Convey need for snapshot-merge target in lvconvert error message and man
page.

Add ->target_name to segtype_handler to allow a more specific target
name to be returned based on the state of the segment.

Result of trying to merge a snapshot using a kernel that doesn't have
the snapshot-merge target:

Before:
# lvconvert --merge vg/snap
  Can't expand LV lv: snapshot target support missing from kernel?
  Failed to suspend origin lv

After:
# lvconvert --merge vg/snap
  Can't process LV lv: snapshot-merge target support missing from kernel?
  Failed to suspend origin lv
  Unable to merge LV "snap" into it's origin.

13 years agoTweak WHATS_NEW for devices/disable_after_error_count.
Petr Rockai [Wed, 13 Oct 2010 15:50:34 +0000 (15:50 +0000)]
Tweak WHATS_NEW for devices/disable_after_error_count.

13 years agoTweak the lvm.conf comment about devices/disable_after_error_count.
Petr Rockai [Wed, 13 Oct 2010 15:45:18 +0000 (15:45 +0000)]
Tweak the lvm.conf comment about devices/disable_after_error_count.

13 years agoUpdate WHATS_NEW.
Petr Rockai [Wed, 13 Oct 2010 15:41:52 +0000 (15:41 +0000)]
Update WHATS_NEW.

13 years agoLimit repeated accesses to broken devices.
Petr Rockai [Wed, 13 Oct 2010 15:40:38 +0000 (15:40 +0000)]
Limit repeated accesses to broken devices.

Signed-off-by: Takahiro Yasui <takahiro.yasui@hds.com>
Reviewed-by: Petr Rockai <prockai@redhat.com>
13 years agoUpdate WHATS_NEW.
Petr Rockai [Wed, 13 Oct 2010 13:53:25 +0000 (13:53 +0000)]
Update WHATS_NEW.

13 years agoGive correct error message when creating a too-small snapshot (BZ 587063)
Petr Rockai [Wed, 13 Oct 2010 13:52:53 +0000 (13:52 +0000)]
Give correct error message when creating a too-small snapshot (BZ 587063)

13 years agoDon't use floor() in _bitset_with_random_bits
Zdenek Kabelac [Wed, 13 Oct 2010 12:18:53 +0000 (12:18 +0000)]
Don't use floor() in _bitset_with_random_bits

Use _even_rand() function instead of floor() in _bitset_with_random_bits().
floor() function is missing in dietlibc (on architectures other than x86).
Moreover using floor() to clip rand results does not assure even result
distribution. _even_rand() uses integer arithmetic only and is designed to
return evenly distributed results.

> Looks OK to me. It took a while to decipher what is the exact meaning of
> the loop in _even_rand (to a non-pseudorandomness-expert) but I am
> fairly comfortable with it now. If I understand this correctly, it
> rejects numbers that come from an "incomplete" slice of the RAND_MAX
> space (considering the number space [0, RAND_MAX] is divided into some
> "max"-sized slices and at most a single smaller slice, between [n*max,
> RAND_MAX] for suitable n -- numbers from this last slice are discarded
> because they could distort the distribution in favour of smaller
> numbers).

Signed-off-by: Przemyslaw Iskra <sparky <at> pld-linux.org>
Reviewed-by: Petr Rockai <prockai <at> redhat.com>
13 years agoUpdate WHATS_NEW.
Petr Rockai [Wed, 13 Oct 2010 10:37:27 +0000 (10:37 +0000)]
Update WHATS_NEW.

13 years agoAdd a test for vgextend --restoremissing.
Petr Rockai [Wed, 13 Oct 2010 10:36:26 +0000 (10:36 +0000)]
Add a test for vgextend --restoremissing.

13 years agoImplement vgextend --restoremissing (BZ 537913), which makes it possible to
Petr Rockai [Wed, 13 Oct 2010 10:34:31 +0000 (10:34 +0000)]
Implement vgextend --restoremissing (BZ 537913), which makes it possible to
re-add a physical volume that has gone missing previously, due to a transient
device failure, without re-initialising it.

Signed-off-by: Petr Rockai <prockai@redhat.com>
Reviewed-by: Alasdair Kergon <agk@redhat.com>
13 years agoSkip fsadm testing until proper installation rules are commited in.
Zdenek Kabelac [Wed, 13 Oct 2010 09:44:52 +0000 (09:44 +0000)]
Skip fsadm testing until proper installation rules are commited in.

For now testing of fsadm is broken - as it's executing fsadm from system
and not from the package thus we get wrong results.

13 years agoFix lv_modules_dup segfault.
Dave Wysochanski [Tue, 12 Oct 2010 17:09:23 +0000 (17:09 +0000)]
Fix lv_modules_dup segfault.

13 years agoMake lvconvert respect --yes/--force in the inactive log conversion
Petr Rockai [Tue, 12 Oct 2010 16:41:17 +0000 (16:41 +0000)]
Make lvconvert respect --yes/--force in the inactive log conversion
prompt. Fixes BZs 642055, 621281. Patch by Taka.

Signed-off-by: Takahiro Yasui <tyasui@redhat.com>
Reviewed-by: Petr Rockai <prockai@redhat.com>
13 years agoupdate WHATS_NEW
Dave Wysochanski [Tue, 12 Oct 2010 16:17:50 +0000 (16:17 +0000)]
update WHATS_NEW

13 years agoAdd an option to skip some tests in make check (regex based, like T=): eg.
Petr Rockai [Tue, 12 Oct 2010 16:17:25 +0000 (16:17 +0000)]
Add an option to skip some tests in make check (regex based, like T=): eg.
$ sudo make check S='mirror-basic|fsadm'

13 years agotest-utils: Fix a slight bug in the dmeventd-already-running error message.
Petr Rockai [Tue, 12 Oct 2010 16:13:43 +0000 (16:13 +0000)]
test-utils: Fix a slight bug in the dmeventd-already-running error message.

13 years agoRefactor and add code for (lv) 'modules' get function.
Dave Wysochanski [Tue, 12 Oct 2010 16:13:06 +0000 (16:13 +0000)]
Refactor and add code for (lv) 'modules' get function.

13 years agoRefactor and add code for (lv) 'mirror_log' get function.
Dave Wysochanski [Tue, 12 Oct 2010 16:12:50 +0000 (16:12 +0000)]
Refactor and add code for (lv) 'mirror_log' get function.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Reviewed-By: Petr Rockai <prockai@redhat.com>
13 years agoRefactor and add code for (lv) 'lv_kernel_{major|minor}' get functions.
Dave Wysochanski [Tue, 12 Oct 2010 16:12:33 +0000 (16:12 +0000)]
Refactor and add code for (lv) 'lv_kernel_{major|minor}' get functions.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Reviewed-By: Petr Rockai <prockai@redhat.com>
13 years agoRefactor and add code for (lv) 'convert_lv' get function.
Dave Wysochanski [Tue, 12 Oct 2010 16:12:18 +0000 (16:12 +0000)]
Refactor and add code for (lv) 'convert_lv' get function.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Reviewed-By: Petr Rockai <prockai@redhat.com>
13 years agoRefactor and add code for (lv) 'move_pv' get function.
Dave Wysochanski [Tue, 12 Oct 2010 16:12:02 +0000 (16:12 +0000)]
Refactor and add code for (lv) 'move_pv' get function.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Reviewed-By: Petr Rockai <prockai@redhat.com>
13 years agoRefactor and add code for (lv) 'origin_size' get function.
Dave Wysochanski [Tue, 12 Oct 2010 16:11:48 +0000 (16:11 +0000)]
Refactor and add code for (lv) 'origin_size' get function.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Reviewed-By: Petr Rockai <prockai@redhat.com>
13 years agoRefactor and add code for (lv) 'lv_path' get function.
Dave Wysochanski [Tue, 12 Oct 2010 16:11:34 +0000 (16:11 +0000)]
Refactor and add code for (lv) 'lv_path' get function.

13 years agoAdd some lv 'get' functions that require no refactoring.
Dave Wysochanski [Tue, 12 Oct 2010 16:11:20 +0000 (16:11 +0000)]
Add some lv 'get' functions that require no refactoring.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Reviewed-By: Petr Rockai <prockai@redhat.com>
13 years agoUpdate script for fsadm testing
Zdenek Kabelac [Fri, 8 Oct 2010 15:03:21 +0000 (15:03 +0000)]
Update script for fsadm testing

13 years agoAdd support for noninterctive shell execution
Zdenek Kabelac [Fri, 8 Oct 2010 15:02:05 +0000 (15:02 +0000)]
Add support for noninterctive shell execution

Try to distinguish between the case of  using interactive shell and non
interactive running - different combinations of  '-y' and '-p' option
needs to be used for fsck.

13 years agoFix usage of --yes flag for ReiserFS resize
Zdenek Kabelac [Fri, 8 Oct 2010 15:00:06 +0000 (15:00 +0000)]
Fix usage of --yes flag for ReiserFS resize

Put 'dry' before resize command - using dry for echo had no use.

13 years agoFix detection of mounted filesystem.
Zdenek Kabelac [Fri, 8 Oct 2010 14:55:19 +0000 (14:55 +0000)]
Fix detection of mounted filesystem.

Update the way how fsadm detects mounted filesystem.
With udev /dev/dm-XXX paths are now returned - but mount or /proc/mounts
prints names in form of /dev/mapper/vg-lv - so the match was not found.
Fixex RHBZ #638050.

Current solution uses same trick as mount and detects vg-lv name through
/sys where available - this should be reasonable safe.

Instead of calling mount without parameter to get actual mount table,
switch to use /proc/mounts directly.

13 years agoFix assignment of default LVM variable
Zdenek Kabelac [Fri, 8 Oct 2010 14:49:25 +0000 (14:49 +0000)]
Fix assignment of default LVM variable

Fix a typo which does not work in case LVM_BINARY is empty string.
Using proper :-  syntax.

13 years agoSupport for passing --yes flag recursively.
Zdenek Kabelac [Fri, 8 Oct 2010 13:49:20 +0000 (13:49 +0000)]
Support for passing --yes flag recursively.

13 years agoCorrectly respect --dry-run option for fsadm
Zdenek Kabelac [Fri, 8 Oct 2010 13:47:10 +0000 (13:47 +0000)]
Correctly respect --dry-run option for fsadm

Fix missing 'dry' execution of lvresize - fixing problem where resize
command were 'dry-run' executed - but lvresize has been executed for real.

Also adapt code slightly to support better recursive execution of fsadm
through lvresize call.

13 years agoFix a serious bug in the behavior of fasdm tool when breaked.
Zdenek Kabelac [Fri, 8 Oct 2010 12:35:56 +0000 (12:35 +0000)]
Fix a serious bug in the behavior of fasdm tool when breaked.

Under certain conditions it was possible to break (^C) fsadm before actually
resizing filesystem, but lvresize which executed fsadm will think resize
was succesful and shrinks partitions with unresized filesystem on it.

Fix by returning error (1) for this case - this stops lvresize from futher
proceding in resize operation.

13 years agoReplace "can not" with "cannot"
Zdenek Kabelac [Fri, 8 Oct 2010 11:18:29 +0000 (11:18 +0000)]
Replace  "can not" with "cannot"

13 years agoAllow CC to be overridden at build time (for 'scan-build make').
Alasdair Kergon [Thu, 7 Oct 2010 16:33:34 +0000 (16:33 +0000)]
Allow CC to be overridden at build time (for 'scan-build make').

13 years agoRename 'flags' to 'status' for struct metadata_area.
Dave Wysochanski [Tue, 5 Oct 2010 17:34:05 +0000 (17:34 +0000)]
Rename 'flags' to 'status' for struct metadata_area.

In other LVM memory structures such as volume_group, the field
used to store flags is called "status", and on-disk fields are called
'flags', so rename the one inside metadata_area to be consistent.
Not only is it more consistent with existing code but is cleaner
to say "the status of this mda is ignored".

Background for this patch - prajnoha pinged me on IRC this morning
about a fix he was working on related to metadataignore when
metadata/dirs was set.  I was reviewing my patches from this year
and realized the 'flags' field was probably not the best choice
when I originally did the metadataignore patches.

13 years agoRestrict lvm1 partial mode.
Milan Broz [Mon, 4 Oct 2010 18:59:01 +0000 (18:59 +0000)]
Restrict lvm1 partial mode.

Current lvm1 allocation code seems to not properly
map segments on missing PVs.

For now disable this functionality.
(It never worked and previous commit just introduced segfault here.)

So the partial mode in lvm1 can only process missing PVs
with no LV segments only.

Also do not use random PV UUID for missing part but use fixed
string derived from VG UUID (to not confuse clvmd tests).

13 years agoAdd dm_zalloc and use it and dm_pool_zalloc throughout.
Alasdair Kergon [Thu, 30 Sep 2010 21:06:50 +0000 (21:06 +0000)]
Add dm_zalloc and use it and dm_pool_zalloc throughout.

13 years agoFix copyright dates on new files lib/metadata/{lv|vg|pv}.[ch].
Dave Wysochanski [Thu, 30 Sep 2010 20:47:18 +0000 (20:47 +0000)]
Fix copyright dates on new files lib/metadata/{lv|vg|pv}.[ch].

13 years agoUpdate WHATS_NEW for commits related to generic property functions
Dave Wysochanski [Thu, 30 Sep 2010 14:26:48 +0000 (14:26 +0000)]
Update WHATS_NEW for commits related to generic property functions

13 years agoFix memory leak of vg_read while using live copies of metadata in directories.
Peter Rajnoha [Thu, 30 Sep 2010 14:12:14 +0000 (14:12 +0000)]
Fix memory leak of vg_read while using live copies of metadata in directories.

13 years agoAdd pv_get_property and create generic internal _get_property function.
Dave Wysochanski [Thu, 30 Sep 2010 14:09:45 +0000 (14:09 +0000)]
Add pv_get_property and create generic internal _get_property function.

We need to use a similar function for pv and lv properties, so just make
a generic _get_property() function that contains most of the required
functionality.  Also, add a check to ensure the field name matches the
object passed in by re-using report_type_t enum.  For pv properties,
the report_type might be either PVS or LABEL.

In addition, add 'const' to 'get' functions object parameter, but not
'set' functions.  Add _not_implemented_set() and _not_implemented_get()
functions.

13 years agoAdd pv 'get' functions for all pv properties.
Dave Wysochanski [Thu, 30 Sep 2010 14:09:33 +0000 (14:09 +0000)]
Add pv 'get' functions for all pv properties.

Add 'get' functions for all pv properties.
Multiply by SECTOR_SIZE for pv properties pv_mda_free, pv_mda_size,
pe_start, pv_size, pv_free, pv_used.

13 years agoAdd pv_name_dup() and pv_fmt_dup() helper functions.
Dave Wysochanski [Thu, 30 Sep 2010 14:09:22 +0000 (14:09 +0000)]
Add pv_name_dup() and pv_fmt_dup() helper functions.

13 years agoAdd pv_mda_size, pv_mda_free, and pv_used functions, call from 'disp' functions.
Dave Wysochanski [Thu, 30 Sep 2010 14:09:10 +0000 (14:09 +0000)]
Add pv_mda_size, pv_mda_free, and pv_used functions, call from 'disp' functions.

13 years agoAdd 'get' functions for vg fields.
Dave Wysochanski [Thu, 30 Sep 2010 14:08:58 +0000 (14:08 +0000)]
Add 'get' functions for vg fields.

Add 'get' functions based on generic macros for VG, PV, and LV.
Add 'get' functions for vg string fields, vg_name, vg_fmt, vg_sysid,
vg_uuid, vg_attr, and vg_tags, and all numeric fields.

13 years agoMake generic GET_*_PROPERTY_FN macros and define secondary macro for vg, pv, lv.
Dave Wysochanski [Thu, 30 Sep 2010 14:08:46 +0000 (14:08 +0000)]
Make generic GET_*_PROPERTY_FN macros and define secondary macro for vg, pv, lv.

Will need similar macros for VG, PV and LV, so define a generic one, and just
pass in the struct name and variable name for the specific macro.

13 years agoAdd supporting functions vg_name_dup, vg_fmt_dup, vg_system_id_dup.
Dave Wysochanski [Thu, 30 Sep 2010 14:08:33 +0000 (14:08 +0000)]
Add supporting functions vg_name_dup, vg_fmt_dup, vg_system_id_dup.

Add supporting functions for vg_name, vg_fmt, vg_system_id.
Append "_dup" to end of supporting functions to make clear the strings
are dup'd and to avoid namespace conflict with vg_name.

13 years agoAdd pv_tags_dup, vg_tags_dup, lv_tags_dup functions that call tags_format_and_copy.
Dave Wysochanski [Thu, 30 Sep 2010 14:08:19 +0000 (14:08 +0000)]
Add pv_tags_dup, vg_tags_dup, lv_tags_dup functions that call tags_format_and_copy.

13 years agoAdd tags_format_and_copy() common function and call from _tags_disp.
Dave Wysochanski [Thu, 30 Sep 2010 14:08:07 +0000 (14:08 +0000)]
Add tags_format_and_copy() common function and call from _tags_disp.

Add a common function to allocate memory and format a string of
tags.
Call tags_format_and_copy() from _tags_disp().

13 years agoAdd pv_uuid_dup, vg_uuid_dup, and lv_uuid_dup, and call id_format_and_copy.
Dave Wysochanski [Thu, 30 Sep 2010 14:07:47 +0000 (14:07 +0000)]
Add pv_uuid_dup, vg_uuid_dup, and lv_uuid_dup, and call id_format_and_copy.

Add supporting functions for pv_uuid, vg_uuid, and lv_uuid.
Call new function id_format_and_copy.  Use 'const' where appropriate.
Add "_dup" suffix to indicate memory is being allocated.
Call {pv|vg|lv}_uuid_dup from lvm2app uuid functions.

13 years agoAdd id_format_and_copy() common function and call from _uuid_disp.
Dave Wysochanski [Thu, 30 Sep 2010 14:07:33 +0000 (14:07 +0000)]
Add id_format_and_copy() common function and call from _uuid_disp.

Add supporting uuid function to allocate memory and call id_write_format.
Call id_format_and_copy from _uuid_disp.

13 years agoSimplify logic to create 'attr' strings.
Dave Wysochanski [Thu, 30 Sep 2010 14:07:19 +0000 (14:07 +0000)]
Simplify logic to create 'attr' strings.

This patch addresses code review request to simplify creation of 'attr'
strings.  The simplification is done in this separate patch to more
easily review and ensure the simplification is done without error.

13 years agoAdd {pv|vg|lv}_attr_dup() functions and refactor 'disp' functions.
Dave Wysochanski [Thu, 30 Sep 2010 13:52:55 +0000 (13:52 +0000)]
Add {pv|vg|lv}_attr_dup() functions and refactor 'disp' functions.

Move the creating of the 'attr' strings into a common function so
they can be called from the 'disp' functions as well as the new
'get' property functions.
Add "_dup" suffix to indicate memory is allocated.
Refactor pvstatus_disp to take pv argument and call pv_attr_dup().

13 years agoAdd lib/metadata/vg.[ch] and lib/metadata/lv.[ch].
Dave Wysochanski [Thu, 30 Sep 2010 13:16:55 +0000 (13:16 +0000)]
Add lib/metadata/vg.[ch] and lib/metadata/lv.[ch].

These got missed when git cvsexportcommit was used.

13 years agoAdd lib/metadata/pv.[ch] new files.
Dave Wysochanski [Thu, 30 Sep 2010 13:15:42 +0000 (13:15 +0000)]
Add lib/metadata/pv.[ch] new files.

Apparently git cvsexportcommit does not properly add new files
from a git commit.

13 years agoRefactor metadata.[ch] into lv.[ch] for lv functions.
Dave Wysochanski [Thu, 30 Sep 2010 13:05:45 +0000 (13:05 +0000)]
Refactor metadata.[ch] into lv.[ch] for lv functions.

This patch is similar to the other patches for pv and vg
functionality, and separates lv functionality into separate
files, concentrating on reporting fields and simple functions.

13 years agoRefactor metadata.[ch] into pv.[ch] for pv functions.
Dave Wysochanski [Thu, 30 Sep 2010 13:05:20 +0000 (13:05 +0000)]
Refactor metadata.[ch] into pv.[ch] for pv functions.

The metadata.[ch] files are very large.  This patch makes a first
attempt at separating out pv functions and data, particularly
related to the reporting fields calculations.

More code could be moved here but for now I'm stopping at reporting
functions 'get' / 'set' functions.

13 years agoRefactor metadata.[ch] into vg.[ch] for vg functions.
Dave Wysochanski [Thu, 30 Sep 2010 13:04:55 +0000 (13:04 +0000)]
Refactor metadata.[ch] into vg.[ch] for vg functions.

The metadata.[ch] files are very large.  This patch makes a first
attempt at separating out vg functions and data, particularly
related to the reporting fields calculations.

13 years agoFix memory leak of config_tree
Zdenek Kabelac [Thu, 30 Sep 2010 11:44:54 +0000 (11:44 +0000)]
Fix memory leak of config_tree

Adding missing destroy_config_tree() for cft_override if it has been allocated.

13 years agoFix leaked pool report
Zdenek Kabelac [Thu, 30 Sep 2010 11:40:14 +0000 (11:40 +0000)]
Fix leaked pool report

Swap pool destruction order in dmeventd_lvm2_exit() to fix leak report.

13 years agoMaps fix
Zdenek Kabelac [Thu, 30 Sep 2010 11:32:40 +0000 (11:32 +0000)]
Maps fix

Read complete content of /proc/self/maps into one buffer without
realocation in the middle of reading and before doing any m/unlock
operation with these lines - as some of them gets change.
With previous implementation we've read some mappings twice ([stack])

13 years agoAdd missing cleanup rule for generated .exported_symbols_generated
Zdenek Kabelac [Thu, 30 Sep 2010 10:08:58 +0000 (10:08 +0000)]
Add missing cleanup rule for generated .exported_symbols_generated

13 years agoSpeed up unquoting of quoted double quotes and backslashes.
Alasdair Kergon [Tue, 28 Sep 2010 01:29:06 +0000 (01:29 +0000)]
Speed up unquoting of quoted double quotes and backslashes.

13 years agodrop an unnecessary 'stack'
Alasdair Kergon [Mon, 27 Sep 2010 19:15:13 +0000 (19:15 +0000)]
drop an unnecessary 'stack'

13 years agowas renamed
Alasdair Kergon [Mon, 27 Sep 2010 19:10:46 +0000 (19:10 +0000)]
was renamed

13 years agoSpeed up CRC32 calculations by using a larger lookup table.
Alasdair Kergon [Mon, 27 Sep 2010 19:09:34 +0000 (19:09 +0000)]
Speed up CRC32 calculations by using a larger lookup table.

Use -DDEBUG_CRC32 to revert to old function and check new one gives same result.

13 years agopre-release v2_02_74
Alasdair Kergon [Fri, 24 Sep 2010 16:24:57 +0000 (16:24 +0000)]
pre-release

13 years agoAdd escape sequence for ':' and '@' found in device names used as PVs.
Peter Rajnoha [Thu, 23 Sep 2010 12:02:33 +0000 (12:02 +0000)]
Add escape sequence for ':' and '@' found in device names used as PVs.

13 years agoReplace alloca with dm_malloc in _aligned_io.
Alasdair Kergon [Wed, 22 Sep 2010 22:31:45 +0000 (22:31 +0000)]
Replace alloca with dm_malloc in _aligned_io.

(This section of code dates from 2.4 and could be written more efficiently nowadays.)

13 years agoFix handling of partial VG for lvm1 format metadata
Milan Broz [Wed, 22 Sep 2010 13:45:21 +0000 (13:45 +0000)]
Fix handling of partial VG for lvm1 format metadata

If some lvm1 device is missing, lvm fails on all operations
# vgcfgbackup -f bck -P vg_test
  Partial mode. Incomplete volume groups will be activated read-only.
  3 PV(s) found for VG vg_test: expected 4
  PV segment VG free_count mismatch: 152599 != 228909
  PV segment VG extent_count mismatch: 152600 != 228910
  Internal error: PV segments corrupted in vg_test.
  Volume group "vg_test" not found

Allow loading of lvm1 partial VG by allocating "new" missing PV,
which covers lost space. Also this fake mising PV inform code
that it is partial VG.

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

13 years agoFix name in msg in last checkin.
Alasdair Kergon [Wed, 22 Sep 2010 01:50:38 +0000 (01:50 +0000)]
Fix name in msg in last checkin.

(The problem the last checkin addressed was a segfault in 'pvs -a' if .cache
didn't contain every PV in a VG.)

13 years agoTrack recursive filter iteration to avoid refreshing while in use. (2.02.56)
Alasdair Kergon [Wed, 22 Sep 2010 01:36:13 +0000 (01:36 +0000)]
Track recursive filter iteration to avoid refreshing while in use. (2.02.56)

13 years ago"goto_bad" should be used in alloc_printed_tags function, not "goto bad".
Peter Rajnoha [Tue, 21 Sep 2010 10:42:02 +0000 (10:42 +0000)]
"goto_bad" should be used in alloc_printed_tags function, not "goto bad".

13 years agoRevert to old glibc behaviour for vsnprintf used in emit_to_buffer function.
Peter Rajnoha [Mon, 20 Sep 2010 14:25:27 +0000 (14:25 +0000)]
Revert to old glibc behaviour for vsnprintf used in emit_to_buffer function.

Revert to old glibc behaviour for vsnprintf used in emit_to_buffer fn.
Otherwise, the check that follows would be wrong for new glibc versions.
This caused the rh bug #633033 to be undetected and pass throught the check,
corrupting the metadata!

13 years agoUse dynamic allocation for metadata's tag buffer (removes 4096 char. limit).
Peter Rajnoha [Mon, 20 Sep 2010 14:23:20 +0000 (14:23 +0000)]
Use dynamic allocation for metadata's tag buffer (removes 4096 char. limit).

13 years agoUpdate vg_mda_free 'get' function to multiply by SECTOR_SIZE.
Dave Wysochanski [Thu, 9 Sep 2010 19:38:03 +0000 (19:38 +0000)]
Update vg_mda_free 'get' function to multiply by SECTOR_SIZE.

13 years agoAdd random suffix to archive file names to prevent races when being created.
Peter Rajnoha [Thu, 9 Sep 2010 13:13:12 +0000 (13:13 +0000)]
Add random suffix to archive file names to prevent races when being created.

In certain configurations, we're not under a VG rw lock while trying to write
a new archive file with VG metadata. A common example is using "vgs" while
having the content of backup and archive directories empty. The code scans the
content of these directories and tries to determine the final index that should
be used in archive name. Since we're not under a lock, we can get into a race
while choosing the index which could end up showing errors about not being able
to rename to final archive name. Let's add random number suffix to these archive
file names so we can avoid the race.

13 years agoReinitialize archive and backup handling on toolcontext refresh.
Peter Rajnoha [Thu, 9 Sep 2010 13:07:13 +0000 (13:07 +0000)]
Reinitialize archive and backup handling on toolcontext refresh.

For example, when using '--config "backup { ... }"' line, the values from
lvm.conf (or default values) should be overridden. This patch adds
reinitialisation of archive and backup handling on toolcontext refresh
which makes these settings to be applied.

13 years agoThis patch fixes an issue where cluster mirror write I/O
Jonathan Earl Brassow [Mon, 30 Aug 2010 18:37:42 +0000 (18:37 +0000)]
This patch fixes an issue where cluster mirror write I/O
can be opprobriously slow if created with '--nosync'.

One of the ways cluster mirrors coordinate I/O and recovery
amoung the different machines is by the use of the log
function 'is_remote_recovering()' which lets nodes know if
a region they wish to perform a write on is currently being
recovered on another node.  If the region is being recovered,
the I/O is delayed.

The 'is_remote_recovering' routine has been optimized to
avoid the deluge of requests that would be issued to the
userspace log server by maintaining a marker of how far
the recovery has gotten.  It can then immediately return
'not recovering' if the region being inquired about is
less than this mark.  Additionally, if the region of
concern is greater than the mark, the function will
limit the number of transmissions to userspace by assuming
the region /is/ being recovered when skipping the
transmission.  This limits the amount of processing
and updates the mark in 1/4 sec time steps.

This patch fixes a problem where 'the mark' is not being
updated because of faulty logic in the userspace log
daemon.  When '--nosync' is used to create a cluster
mirror, the userspace log daemon never has a chance
to update the mark in the normal way.  The fix is to set
the mark to "complete" if the mirror was created with
the --nosync flag.

13 years agoDo not run singlenode clvmd tests if support for singlenode not compiled in.
Milan Broz [Fri, 27 Aug 2010 08:52:54 +0000 (08:52 +0000)]
Do not run singlenode clvmd tests if support for singlenode not compiled in.

13 years agoCurrently tests require SI units enabled and data alignment to 1MiB.
Milan Broz [Fri, 27 Aug 2010 07:59:40 +0000 (07:59 +0000)]
Currently tests require SI units enabled and data alignment to 1MiB.

For now force it in lvm.conf (otherwise it fails on older systems like RHEL5
where are these options disabled by default).

FIXME: it should test and detect both versions.

13 years agoThis patch fixes a problem where the mirror polling process
Jonathan Earl Brassow [Thu, 26 Aug 2010 16:29:12 +0000 (16:29 +0000)]
This patch fixes a problem where the mirror polling process
may never complete.

If you convert from a linear to a mirror and then convert that
mirror back to linear /while/ the previous (up)convert is
taking place, the mirror polling process will never complete.
This is because the function that polls the mirror for
completion doesn't check if it is still polling a mirror and
the copy_percent that it gets back from the linear device is
certainly never 100%.

The fix is simply to check if the daemon is still looking at
a mirror device - if not, return PROGRESS_CHECK_FAILED.

The user sees the following output from the first (up)convert
if someone else sneaks in and does a down-convert shortly
after their convert:
[root@bp-01 ~]# lvconvert -m1 vg/lv
  vg/lv: Converted: 43.4%
  ABORTING: Mirror percentage check failed.

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