]> sourceware.org Git - lvm2.git/log
lvm2.git
13 years agoMore scavenging of common daemon code, this time the clvmd local socket setup
Petr Rockai [Fri, 13 May 2011 09:34:12 +0000 (09:34 +0000)]
More scavenging of common daemon code, this time the clvmd local socket setup
sequence.

13 years agoStart filling in some of the common daemon (server-side) functionality, taking
Petr Rockai [Fri, 13 May 2011 08:45:46 +0000 (08:45 +0000)]
Start filling in some of the common daemon (server-side) functionality, taking
dmeventd code as a starting point.

13 years agoFirst go at the lvmetad client-side interface.
Petr Rockai [Fri, 13 May 2011 08:17:26 +0000 (08:17 +0000)]
First go at the lvmetad client-side interface.

13 years agoFirst stab at the prototypes of the daemon-common functionality (to be
Petr Rockai [Fri, 13 May 2011 08:07:28 +0000 (08:07 +0000)]
First stab at the prototypes of the daemon-common functionality (to be
eventually shared by dmeventd, lvmetad and clvmd).

13 years agoInitial design document for LVMetaD, building on the draft from June of last
Petr Rockai [Thu, 12 May 2011 17:49:46 +0000 (17:49 +0000)]
Initial design document for LVMetaD, building on the draft from June of last
year, incorporating the outcomes of today's and yesterday's discussions.

13 years agoDo not issue an error message when unable to remove .cache on read-only fs.
Peter Rajnoha [Thu, 12 May 2011 12:42:47 +0000 (12:42 +0000)]
Do not issue an error message when unable to remove .cache on read-only fs.

13 years agoUpdate WHATS_NEW.
Petr Rockai [Sat, 7 May 2011 15:52:50 +0000 (15:52 +0000)]
Update WHATS_NEW.

13 years agoRewrite vgreduce --removemissing --force, using existing primitives:
Petr Rockai [Sat, 7 May 2011 15:52:16 +0000 (15:52 +0000)]
Rewrite vgreduce --removemissing --force, using existing primitives:
lv_remove_with_dependencies and mirror_remove_missing (the latter coming from
lvconvert). Remove substantial amount of legacy code.

13 years agoAdd a new entry point in the mirror lvconvert code, for removing missing mirror
Petr Rockai [Sat, 7 May 2011 13:56:13 +0000 (13:56 +0000)]
Add a new entry point in the mirror lvconvert code, for removing missing mirror
images and/or logs, without attempting any further actions.

13 years agoWhen glibc needs buffers for line buffering of input and output buffers, it
Petr Rockai [Sat, 7 May 2011 13:50:11 +0000 (13:50 +0000)]
When glibc needs buffers for line buffering of input and output buffers, it
allocates these buffers in such way it adds memory page for each such buffer
and size of unlock memory check will mismatch by 1 or 2 pages.

This happens when we print or read lines without '\n' so these buffers are
used. To avoid this extra allocation, use setvbuf to set these bufffers ahead.

Signed-off-by: Zdenek Kabelac <zkabelac@redhat.com>
Reviewed-by: Milan Broz <mbroz@redhat.com>
Reviewed-by: Petr Rockai <prockai@redhat.com>
13 years agoMake vg_mark_partial_lvs also clear existing PARTIAL_LV flags, so it can be
Petr Rockai [Sat, 7 May 2011 13:32:05 +0000 (13:32 +0000)]
Make vg_mark_partial_lvs also clear existing PARTIAL_LV flags, so it can be
issued repeatedly on the same VG, keeping the PARTIAL_LV flags up to date.

13 years agotest update without WHATS_NEW to check it gives warning now
Alasdair Kergon [Fri, 29 Apr 2011 19:06:17 +0000 (19:06 +0000)]
test update without WHATS_NEW to check it gives warning now

13 years agotest
Alasdair Kergon [Fri, 29 Apr 2011 19:05:11 +0000 (19:05 +0000)]
test

13 years agotest
Alasdair Kergon [Fri, 29 Apr 2011 19:01:59 +0000 (19:01 +0000)]
test

13 years agotest
Alasdair Kergon [Fri, 29 Apr 2011 19:01:59 +0000 (19:01 +0000)]
test

13 years agotest
Alasdair Kergon [Fri, 29 Apr 2011 18:57:09 +0000 (18:57 +0000)]
test

13 years agotest
Alasdair Kergon [Fri, 29 Apr 2011 18:56:35 +0000 (18:56 +0000)]
test

13 years agotest
Alasdair Kergon [Fri, 29 Apr 2011 18:48:50 +0000 (18:48 +0000)]
test

13 years agotest
Alasdair Kergon [Fri, 29 Apr 2011 18:43:31 +0000 (18:43 +0000)]
test

13 years agotest
Alasdair Kergon [Fri, 29 Apr 2011 18:41:46 +0000 (18:41 +0000)]
test

13 years agotest
Alasdair Kergon [Fri, 29 Apr 2011 18:40:55 +0000 (18:40 +0000)]
test

13 years agotest
Alasdair Kergon [Fri, 29 Apr 2011 18:40:14 +0000 (18:40 +0000)]
test

13 years agopost-release
Alasdair Kergon [Fri, 29 Apr 2011 17:05:20 +0000 (17:05 +0000)]
post-release

13 years agowake buildbot
Alasdair Kergon [Fri, 29 Apr 2011 16:27:09 +0000 (16:27 +0000)]
wake buildbot

13 years agocommands/toolcontext.c:578: warning: ‘udev_dir’ may be used uninitialized in...
Alasdair Kergon [Fri, 29 Apr 2011 16:23:39 +0000 (16:23 +0000)]
commands/toolcontext.c:578: warning: â€˜udev_dir’ may be used uninitialized in this function
commands/toolcontext.c:576: warning: â€˜udev_dir_len’ may be used uninitialized in this function

Bogus - suppress them.

13 years agopre-release
Alasdair Kergon [Fri, 29 Apr 2011 16:12:21 +0000 (16:12 +0000)]
pre-release

13 years agopre-release clean-ups
Alasdair Kergon [Fri, 29 Apr 2011 00:21:13 +0000 (00:21 +0000)]
pre-release clean-ups

13 years agoAdd missing cleanup for vgimportclone script
Zdenek Kabelac [Thu, 28 Apr 2011 22:17:06 +0000 (22:17 +0000)]
Add missing cleanup for vgimportclone script

13 years agoclean up critical section patch
Alasdair Kergon [Thu, 28 Apr 2011 20:29:59 +0000 (20:29 +0000)]
clean up critical section patch

13 years agoMissing space in debug message
Zdenek Kabelac [Thu, 28 Apr 2011 19:59:17 +0000 (19:59 +0000)]
Missing space in debug message

13 years agoSet pv_min_size to 2048KB to exclude floppy drives.
Alasdair Kergon [Thu, 28 Apr 2011 17:33:34 +0000 (17:33 +0000)]
Set pv_min_size to 2048KB to exclude floppy drives.
Previously was 512.

13 years agoAdd missing pkg_config_init check with --enable-udev_sync.
Alasdair Kergon [Thu, 28 Apr 2011 16:54:32 +0000 (16:54 +0000)]
Add missing pkg_config_init check with --enable-udev_sync.

13 years agoAdjust pvmove man page wording.
Alasdair Kergon [Thu, 28 Apr 2011 16:22:47 +0000 (16:22 +0000)]
Adjust pvmove man page wording.

Add missing --alloc anywhere to example and mention that snapshots and
mirrors can't be moved.

13 years agoUncomment obtain_device_list_from_udev setting in lvm.conf.
Peter Rajnoha [Tue, 26 Apr 2011 09:09:24 +0000 (09:09 +0000)]
Uncomment obtain_device_list_from_udev setting in lvm.conf.

Just for consistency with other settings we already have in lvm.conf.

13 years agoautoreconf
Peter Rajnoha [Fri, 22 Apr 2011 12:13:05 +0000 (12:13 +0000)]
autoreconf

13 years agoUse common udev_get_dev_dir() to get current device directory managed by udev.
Peter Rajnoha [Fri, 22 Apr 2011 12:07:35 +0000 (12:07 +0000)]
Use common udev_get_dev_dir() to get current device directory managed by udev.

13 years agoObtain device list from udev by default if LVM2 is compiled with udev support.
Peter Rajnoha [Fri, 22 Apr 2011 12:05:32 +0000 (12:05 +0000)]
Obtain device list from udev by default if LVM2 is compiled with udev support.

Also, add a new 'obtain_device_list_from_udev' setting to lvm.conf with which
we can turn this feature on or off if needed.

If set, the cache of block device nodes with all associated symlinks
will be constructed out of the existing udev database content.
This avoids using and opening any inapplicable non-block devices or
subdirectories found in the device directory. This setting is applied
to udev-managed device directory only, other directories will be scanned
fully. LVM2 needs to be compiled with udev support for this setting to
take effect. N.B. Any device node or symlink not managed by udev in
udev directory will be ignored with this setting on.

13 years agoMove common libudev code to lvm-wrappers.[ch].
Peter Rajnoha [Fri, 22 Apr 2011 11:59:59 +0000 (11:59 +0000)]
Move common libudev code to lvm-wrappers.[ch].

...so we can use it throughout.

13 years agoRequire libudev >= 143 when compiling with udev support.
Peter Rajnoha [Fri, 22 Apr 2011 11:56:41 +0000 (11:56 +0000)]
Require libudev >= 143 when compiling with udev support.

Old versions of libudev < 143 were experimental and unstable. Require recent
and stable versions only (version 143 is old enough anyway).

13 years agoDisable nightly test for vgimportclone until proper fix is made.
Dave Wysochanski [Thu, 21 Apr 2011 19:06:00 +0000 (19:06 +0000)]
Disable nightly test for vgimportclone until proper fix is made.

This fails on lenny buildslave for some reason.
For now disable the vgimportclone part of the test until proper fix.

Let the first part of the test still run though, which shows pvs working
with duplicate pvs.

13 years agoAdd vgimportclone symlink for nightly test.
Dave Wysochanski [Thu, 21 Apr 2011 17:42:58 +0000 (17:42 +0000)]
Add vgimportclone symlink for nightly test.

13 years agoAdd nightly test for vgimportclone and querying of vgnames with duplicate pvs.
Dave Wysochanski [Thu, 21 Apr 2011 17:03:38 +0000 (17:03 +0000)]
Add nightly test for vgimportclone and querying of vgnames with duplicate pvs.

Related to rhbz 697959.

This test fails prior to these two commits:
commit af112eb2c9a62c5d794df920218bd3ee291d5b25
Author: Zdenek Kabelac <zkabelac@redhat.com>
Date:   Thu Apr 21 13:15:26 2011 +0000

    Skip check for NULL before dm_free

    dm_free makes this test itself.

commit 91419c3e86bf9666aab2aa631faae1ba73e8d745
Author: Zdenek Kabelac <zkabelac@redhat.com>
Date:   Thu Apr 21 13:13:40 2011 +0000

    Fix use of released vgname and vgid

13 years agoSkip check for NULL before dm_free
Zdenek Kabelac [Thu, 21 Apr 2011 13:15:26 +0000 (13:15 +0000)]
Skip check for NULL before dm_free

dm_free makes this test itself.

13 years agoFix use of released vgname and vgid
Zdenek Kabelac [Thu, 21 Apr 2011 13:13:40 +0000 (13:13 +0000)]
Fix use of released vgname and vgid

Avoid using of already released memory when duplicated MDA is found.

As get_pv_from_vg_by_id() may call lvmcache_label_scan() use the local copy
of the vgname and vgid on the stack as vginfo may dissapear and code was
then accessing garbage in memory.

i.e.  pvs  /dev/loop0
(when /dev/loop0 and /dev/loop1 has same MDA content)

Invalid read of size 1
   at 0x523C986: dm_hash_lookup (hash.c:325)
   by 0x440C8C: vginfo_from_vgname (lvmcache.c:399)
   by 0x4605C0: _create_vg_text_instance (format-text.c:1882)
   by 0x46140D: _text_create_text_instance (format-text.c:2243)
   by 0x47EB49: _vg_read (metadata.c:2887)
   by 0x47FBD8: vg_read_internal (metadata.c:3231)
   by 0x477594: get_pv_from_vg_by_id (metadata.c:344)
   by 0x45F07A: _get_pv_if_in_vg (format-text.c:1400)
   by 0x45F0B9: _populate_pv_fields (format-text.c:1414)
   by 0x45F40F: _text_pv_read (format-text.c:1493)
   by 0x480431: _pv_read (metadata.c:3500)
   by 0x4802B2: pv_read (metadata.c:3462)
 Address 0x652ab80 is 0 bytes inside a block of size 4 free'd
   at 0x4C2756E: free (vg_replace_malloc.c:366)
   by 0x442277: _free_vginfo (lvmcache.c:963)
   by 0x44235E: _drop_vginfo (lvmcache.c:992)
   by 0x442B23: _lvmcache_update_vgname (lvmcache.c:1165)
   by 0x443449: lvmcache_update_vgname_and_id (lvmcache.c:1358)
   by 0x443C07: lvmcache_add (lvmcache.c:1492)
   by 0x46588C: _text_read (text_label.c:271)
   by 0x466A65: label_read (label.c:289)
   by 0x4413FC: lvmcache_label_scan (lvmcache.c:635)
   by 0x4605AD: _create_vg_text_instance (format-text.c:1881)
   by 0x46140D: _text_create_text_instance (format-text.c:2243)
   by 0x47EB49: _vg_read (metadata.c:2887)

Add testing script

13 years agoAlways copy all tests to builddir regardless of T/S, since subsequent runs
Petr Rockai [Tue, 19 Apr 2011 15:28:17 +0000 (15:28 +0000)]
Always copy all tests to builddir regardless of T/S, since subsequent runs
(possibly with different T or S) skip that step.

13 years agoImprove the discard documentation. Also improve discard code in
Mike Snitzer [Wed, 13 Apr 2011 18:26:39 +0000 (18:26 +0000)]
Improve the discard documentation.  Also improve discard code in
pv_manip.c to properly account for case when pe_start=0 and the first
physical extent is to be released (currently skip the first extent to
avoid discarding the PV label).

13 years agoUse uint32_t rather than uint64_t.
Mike Snitzer [Tue, 12 Apr 2011 22:04:04 +0000 (22:04 +0000)]
Use uint32_t rather than uint64_t.

13 years agoAdd "devices/issue_discards" to lvm.conf.
Mike Snitzer [Tue, 12 Apr 2011 21:59:01 +0000 (21:59 +0000)]
Add "devices/issue_discards" to lvm.conf.
Issue discards on lvremove if enabled and both storage and kernel have support.

13 years agofix s/then/than/ typo in lvm.conf.5.in
Mike Snitzer [Tue, 12 Apr 2011 21:21:08 +0000 (21:21 +0000)]
fix s/then/than/ typo in lvm.conf.5.in

13 years agofix s/then/than/ typos in 'pv_min_size' section and fold floppy example
Mike Snitzer [Tue, 12 Apr 2011 20:44:41 +0000 (20:44 +0000)]
fix s/then/than/ typos in 'pv_min_size' section and fold floppy example
into documentation preamble.

13 years agoReplace dm_snprintf with strncpy
Zdenek Kabelac [Tue, 12 Apr 2011 14:13:17 +0000 (14:13 +0000)]
Replace dm_snprintf with strncpy

My previous patch fixed incorrect error check for dm_snprintf.
However in this particular case - dm_snprintf has been used differently -
just like strncpy + setting last char with '\0' - so the code had to return
error - because the buffer was to short for whole string.

Patch replaces it with real strncpy.
Also test for alloca() failure is removed - as the program behaviour
is rather undefined in this case - it never returns NULL.

13 years agoMake the mirror log checks in t-lvconvert-repair-policy a bit more strict
Petr Rockai [Tue, 12 Apr 2011 12:39:24 +0000 (12:39 +0000)]
Make the mirror log checks in t-lvconvert-repair-policy a bit more strict
(i.e. accurate).

13 years agoThis patchset refactors some reporting code and completes the remaining
Petr Rockai [Tue, 12 Apr 2011 12:24:29 +0000 (12:24 +0000)]
This patchset refactors some reporting code and completes the remaining
lvseg properties for lvm2app, 'devices' and 'seg_pe_ranges'.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Reviewed-by: Petr Rockai <prockai@redhat.com>
13 years agoFix incorrect tests for dm_snprintf() failure
Zdenek Kabelac [Sat, 9 Apr 2011 19:05:23 +0000 (19:05 +0000)]
Fix incorrect tests for dm_snprintf() failure

As the memory is preallocated based on arg size in these cases,
the error would be quite hard to trigger here anyway.

13 years agoFix some unmatching sign comparation gcc warnings
Zdenek Kabelac [Fri, 8 Apr 2011 14:40:18 +0000 (14:40 +0000)]
Fix some unmatching sign comparation gcc warnings

Simple replacement for unsigned type - usually in for() loops.

13 years agoAdd missing printf attributes
Zdenek Kabelac [Fri, 8 Apr 2011 14:21:34 +0000 (14:21 +0000)]
Add missing printf attributes

These attributes were missing in previous patch, that was adding
instrumentation for printf formating string parameter.

13 years agoUse dm_snprintf
Zdenek Kabelac [Fri, 8 Apr 2011 14:18:40 +0000 (14:18 +0000)]
Use dm_snprintf

and fix differently signed comparation.

13 years agoBetter const cast logic
Zdenek Kabelac [Fri, 8 Apr 2011 14:14:57 +0000 (14:14 +0000)]
Better const cast logic

(although still gcc gives const violation warning)

13 years agoFix some forgotten -Wold-style-definition gcc warnings
Zdenek Kabelac [Fri, 8 Apr 2011 14:13:08 +0000 (14:13 +0000)]
Fix some forgotten -Wold-style-definition gcc warnings

13 years agoNewer gcc doesn't need this trick
Zdenek Kabelac [Fri, 8 Apr 2011 14:11:40 +0000 (14:11 +0000)]
Newer gcc doesn't need this trick

In fact it now generates an opposite warning about using undefined variable.

13 years agoThanks to Zdenek Kabelac (kabi) for pointing out that I was using
Jonathan Earl Brassow [Thu, 7 Apr 2011 21:49:29 +0000 (21:49 +0000)]
Thanks to Zdenek Kabelac (kabi) for pointing out that I was using
dm_pool_free incorrectly.  This check-in fixes that incorrect usage.

I've also added a WHATS_NEW line to reflect the changes I made to allow
lv_extend to operate on 0 length intrinsically layered LVs (i.e mirrors
and RAID).  I forgot that in the last commit.

13 years agoThis patch adds the ability to extend 0 length layered LVs. This
Jonathan Earl Brassow [Wed, 6 Apr 2011 21:32:20 +0000 (21:32 +0000)]
This patch adds the ability to extend 0 length layered LVs.  This
allows us to allocate all images of a mirror (or RAID array) at one
time during create.

The current mirror implementation still requires a separate allocation
for the log, however.

13 years agoAdd rudimentary versioning to the dmevend protocol, allowing us to detect the
Petr Rockai [Mon, 4 Apr 2011 16:11:09 +0000 (16:11 +0000)]
Add rudimentary versioning to the dmevend protocol, allowing us to detect the
(protocol) version of the running dmeventd on the client side.

Right now this is only used in dmeventd -R.

13 years agoCleanup fid finalization code in free_vg and allow exactly the same fid to be set...
Peter Rajnoha [Fri, 1 Apr 2011 14:54:20 +0000 (14:54 +0000)]
Cleanup fid finalization code in free_vg and allow exactly the same fid to be set again for a PV/VG.

Actually, we can call vg_set_fid(vg, NULL) instead of calling
destroy_instance for all PV structs and a VG struct - it's the same
code we already have in the vg_set_fid.

Also, allow exactly the same fid to be set again for the same PV/VG
Before, this could end up with the fid destroyed because we destroyed
existing fid first and then we used the new one and we didn't care
whether existing one == new one by chance.

13 years agoFinalize PV format instances properly in lvm_vg_write fn.
Peter Rajnoha [Fri, 1 Apr 2011 13:44:51 +0000 (13:44 +0000)]
Finalize PV format instances properly in lvm_vg_write fn.

lvm_vg_write fn reinitializes the vg->removed_pvs list. We have to finalize
all PV format instances attached to PVs found in the original list.

13 years agoFix free_vg order
Zdenek Kabelac [Wed, 30 Mar 2011 14:35:00 +0000 (14:35 +0000)]
Fix free_vg order

As now the FID management is more complex, the code inside free_vg needs
to access some parts of memory pools which were not needed before.

For this - makes the order of unlock_and_free_vg() unconditional.
Keek using unlock_and_free_vg() API function.

For properly working VG locking mechanism only the alphabeting locking
orderer needs to be preserved.

TODO: there could be few more code parts simplified when we 'officially'
support of referencies between different memory pools.

13 years agoTesting: remove -q from grep
Zdenek Kabelac [Wed, 30 Mar 2011 13:39:24 +0000 (13:39 +0000)]
Testing: remove -q from grep

to avoid any problems with pipe breaking.

13 years agoUse created hash tables for quick check of LV, PV.
Zdenek Kabelac [Wed, 30 Mar 2011 13:35:51 +0000 (13:35 +0000)]
Use created hash tables for quick check of LV, PV.

Instead of searching linear list of all LVs, PVs - use created hash tables
also for quick mapping between LV.

(Note - for small number of PVs or LVs the overhead of the hash is bigger).

TODO: Use hash tables in volume_group structure directly.

13 years agoKeep the cache content when the exported vg buffer is matching
Zdenek Kabelac [Wed, 30 Mar 2011 13:14:34 +0000 (13:14 +0000)]
Keep the cache content when the exported vg buffer is matching

Instead of regenerating config tree and parsing same data again,
check whether export_vg_to_buffer does not produce same string as
the one already cached - in this case keep it, otherwise throw cached
content away.

For the code simplicity calling _free_cached_vgmetadata() with
vgmetadata == NULL as the function handles this itself.

Note: sometimes export_vg_to_buffer() generates almost the same data
with just different time stamp, but for the patch simplicity,
data are reparsed in this case.

This patch currently helps for vgrefresh.

13 years agoFew more files filtered from memory locking
Zdenek Kabelac [Wed, 30 Mar 2011 13:06:13 +0000 (13:06 +0000)]
Few more files filtered from memory locking

Code located in these files should not be used in critical section.

13 years agoWord alignment for strings
Zdenek Kabelac [Wed, 30 Mar 2011 12:57:03 +0000 (12:57 +0000)]
Word alignment for strings

Align strdup char* allocation just on 2 bytes.
It looks like wasting space to align strings on 8 bytes.
(Could be even 1byte - but for hashing it might eventually get better
perfomance - but probably hardly measurable).

TODO: check on various architectures it's not making any problems.

13 years agoOptimise error message write to _lvm_errmsg
Zdenek Kabelac [Wed, 30 Mar 2011 12:53:04 +0000 (12:53 +0000)]
Optimise error message write to _lvm_errmsg

Isn't usually perfomance critical - but log_error is used i.e.for debuging,
this code noticable slows down the processing.

Added 512KB limit to avoid memory exhastions in case of some endless loop.

TODO: use _lvm_errmsg buffer only when lvm2api needs it.

13 years agoKeep noreturn attribute for lvm_thread_fn
Zdenek Kabelac [Wed, 30 Mar 2011 12:48:16 +0000 (12:48 +0000)]
Keep noreturn attribute for lvm_thread_fn

Even thought my gcc seems to not need it, as it's deduced from pthread_exit(),
keep it here for older compiler to avoid getting warnings.

13 years agoValgrind updates
Zdenek Kabelac [Wed, 30 Mar 2011 12:43:32 +0000 (12:43 +0000)]
Valgrind updates

Avoid locking sum testing with valgrind compilation.

Make memory unaccessible in the valgrind for dm_pool_abadon_object.

Valgrind hinting should not be needed in _free_chunk for dm_free.

13 years agoBetter shutdown for clvmd
Zdenek Kabelac [Wed, 30 Mar 2011 12:36:19 +0000 (12:36 +0000)]
Better shutdown for clvmd

'a small step' towards cleaner shutdown sequence.
Normally clvmd doens't care about unreleased memory on exit -
but for valgrind testing it's better to have them cleaned all.

So - few things are left on exit path - this patch starts to remove
just some of them.

1. lvm_thread_fs is made as a thread which could be joined on exit()
2. memory allocated to local_clien_head list is released.
   (this part is somewhat more complex if the proper reaction is
   needed - and as it requires some heavier code moving - it will
   be resolved later.

13 years agoFix reading of unitialized memory
Zdenek Kabelac [Wed, 30 Mar 2011 12:30:39 +0000 (12:30 +0000)]
Fix reading of unitialized memory

Could be reached via few of our lvm2 test cases:

==11501== Invalid read of size 8
==11501==    at 0x49B2E0: _area_length (import-extents.c:204)
==11501==    by 0x49B40C: _read_linear (import-extents.c:222)
==11501==    by 0x49B952: _build_segments (import-extents.c:323)
==11501==    by 0x49B9A0: _build_all_segments (import-extents.c:334)
==11501==    by 0x49BB4C: import_extents (import-extents.c:364)
==11501==    by 0x497655: _format1_vg_read (format1.c:217)
==11501==    by 0x47E43E: _vg_read (metadata.c:2901)

cut from t-vgcvgbackup-usage.sh
--
pvcreate -M1 $(cat DEVICES)
vgcreate -M1 -c n $vg $(cat DEVICES)
lvcreate -l1 -n $lv1 $vg $dev1
--

Idea of the fix is rather defensive - to allocate one extra element
to 'map' array which is then used in _area_length() - where the
loop checks, whether next map entry is continuous.

By placing there always one extra zero entry -
we fix the read of unallocated memory, and we make sure the data would
not make a continous block.

FIXME: there could be a problem if some special broken lvm1 data would be imported.
As the format1 is currently not really used - leave it for future fix
and use this small hotfix for now.

13 years agoSimplify pool debug initialization
Zdenek Kabelac [Wed, 30 Mar 2011 12:16:15 +0000 (12:16 +0000)]
Simplify pool debug initialization

zalloc pool structure and skip zeroing members.

13 years agoFix 2 signess warnings reported by gcc
Zdenek Kabelac [Wed, 30 Mar 2011 12:14:36 +0000 (12:14 +0000)]
Fix 2 signess warnings reported by gcc

Replace int with unsigned counter.
Replace snprintf with dm_snprintf.

13 years agoUse id_equal instead of strncmp()
Zdenek Kabelac [Tue, 29 Mar 2011 21:57:56 +0000 (21:57 +0000)]
Use id_equal instead of strncmp()

More consistent and easier to read.

13 years agoAdd attribute printf
Zdenek Kabelac [Tue, 29 Mar 2011 21:56:53 +0000 (21:56 +0000)]
Add attribute printf

13 years agoAdd attribute printf
Zdenek Kabelac [Tue, 29 Mar 2011 21:53:46 +0000 (21:53 +0000)]
Add attribute printf

gcc suggested to add these attributes to instrumentat
printf arguments. Adding it for internal functions as well.

13 years agoConst warning fixes
Zdenek Kabelac [Tue, 29 Mar 2011 21:49:18 +0000 (21:49 +0000)]
Const warning fixes

With recent update of dm_report_field_string() API call to accept
completely const objects - we no longer need loose constness here
and keep it forwarding.

13 years agoFix access to released memory
Zdenek Kabelac [Tue, 29 Mar 2011 21:34:18 +0000 (21:34 +0000)]
Fix access to released memory

Invalid primary_vginfo was supposed to move all its lvmcache_infos to
orphan_vginfo - however it has called _drop_vginfo() inside the loop
that released primary_vginfo itself - thus made the loop using released
memory.

Use _vginfo_detach_info() instead and call _drop_vginfo after
th loop is finished.

Valgrind trace it should fix:

Invalid read of size 8
   at 0x41E960: _lvmcache_update_vgname (lvmcache.c:1229)
   by 0x41EF86: lvmcache_update_vgname_and_id (lvmcache.c:1360)
   by 0x441393: _text_read (text_label.c:329)
   by 0x442221: label_read (label.c:289)
   by 0x41CF92: lvmcache_label_scan (lvmcache.c:635)
   by 0x45B303: _vg_read_by_vgid (metadata.c:3342)
   by 0x45B4A6: lv_from_lvid (metadata.c:3381)
   by 0x41B555: lv_activation_filter (activate.c:1346)
   by 0x415868: do_activate_lv (lvm-functions.c:343)
   by 0x415E8C: do_lock_lv (lvm-functions.c:532)
   by 0x40FD5F: do_command (clvmd-command.c:120)
   by 0x413D7B: process_local_command (clvmd.c:1686)
 Address 0x63eba10 is 16 bytes inside a block of size 160 free'd
   at 0x4C2756E: free (vg_replace_malloc.c:366)
   by 0x41DE70: _free_vginfo (lvmcache.c:980)
   by 0x41DEDA: _drop_vginfo (lvmcache.c:998)
   by 0x41E854: _lvmcache_update_vgname (lvmcache.c:1238)
   by 0x41EF86: lvmcache_update_vgname_and_id (lvmcache.c:1360)
   by 0x441393: _text_read (text_label.c:329)
   by 0x442221: label_read (label.c:289)
   by 0x41CF92: lvmcache_label_scan (lvmcache.c:635)
   by 0x45B303: _vg_read_by_vgid (metadata.c:3342)
   by 0x45B4A6: lv_from_lvid (metadata.c:3381)
   by 0x41B555: lv_activation_filter (activate.c:1346)
   by 0x415868: do_activate_lv (lvm-functions.c:343)

problematic line:
dm_list_iterate_items_safe(info2, info3, &primary_vginfo->infos)

13 years agoFix sending uninitilised bytes in cluster messages
Zdenek Kabelac [Tue, 29 Mar 2011 21:05:39 +0000 (21:05 +0000)]
Fix sending uninitilised bytes in cluster messages

Fix 2 more functions sending cluster messages to avoid passing uninitilised bytes
and compensate 1 extra byte attached to the message from the clvm_header.args[1]
member variable.

13 years agoFix -Wold-style-definition gcc warnings
Zdenek Kabelac [Tue, 29 Mar 2011 20:30:05 +0000 (20:30 +0000)]
Fix -Wold-style-definition gcc warnings

13 years agoRemove double braces
Zdenek Kabelac [Tue, 29 Mar 2011 20:19:03 +0000 (20:19 +0000)]
Remove double braces

Clang gives notice about possible confusion as commonly double bracces are
used when some assignment is done inside them.

13 years agogdbinit update
Jonathan Earl Brassow [Tue, 29 Mar 2011 12:53:13 +0000 (12:53 +0000)]
gdbinit update

When doing lv_status_r on a sub_lv, do not climb the tree up past the
starting point.

13 years agos/MIRROR_NOTSYNCED/LV_NOTSYNCED/ - Flag will may refer to more than just mirrors
Jonathan Earl Brassow [Tue, 29 Mar 2011 12:51:57 +0000 (12:51 +0000)]
s/MIRROR_NOTSYNCED/LV_NOTSYNCED/ - Flag will may refer to more than just mirrors

13 years agoReduce amount of vgremove and vgchange calls
Zdenek Kabelac [Mon, 28 Mar 2011 11:35:20 +0000 (11:35 +0000)]
Reduce amount of vgremove and vgchange calls

A bit noticable time defference when whole test-suite is run through valgrind.

13 years agoRename _check_version
Alasdair Kergon [Sun, 27 Mar 2011 13:44:08 +0000 (13:44 +0000)]
Rename _check_version

13 years agoUse hard-coded /dev/mapper/control details for 2.6.36+ kernels and simplify
Alasdair Kergon [Fri, 25 Mar 2011 23:50:35 +0000 (23:50 +0000)]
Use hard-coded /dev/mapper/control details for 2.6.36+ kernels and simplify
associated code.  (Some obscure configurations that happened to work before
are no longer supported.)

13 years agoFix unhandled condition in _move_lv_segments
Jonathan Earl Brassow [Fri, 25 Mar 2011 22:02:27 +0000 (22:02 +0000)]
Fix unhandled condition in _move_lv_segments

If _move_lv_segments is passed a 'lv_from' that does not yet
have any segments, it will screw things up because the code
that does the segment copy assumes there is at least one
segment.  See copy code here:
        lv_to->segments = lv_from->segments;
        lv_to->segments.n->p = &lv_to->segments;
        lv_to->segments.p->n = &lv_to->segments;

If 'segments' is an empty list, the first statement copies over
the values, but the next two reset those values to point to the
other LV's list structure.  'lv_to' now appears to have one
segment, but it is really an ill-set pointer.

13 years agoReplace malloc with zalloc when creating segment_type's
Jonathan Earl Brassow [Fri, 25 Mar 2011 21:59:42 +0000 (21:59 +0000)]
Replace malloc with zalloc when creating segment_type's

13 years agocosmetic change - swapping one macro for another
Jonathan Earl Brassow [Fri, 25 Mar 2011 21:56:28 +0000 (21:56 +0000)]
cosmetic change - swapping one macro for another

When I see 'seg_is_mirrored', I expect the argument to be an lv_segment.
In this case, it is lvcreate_params.  Both structures, have a 'segtype'
entry which the macro dereferences.  However, it just seems easier to
understand if we do 'segtype_is_mirrored' instead.

13 years agoWhat's new.
Petr Rockai [Thu, 24 Mar 2011 16:03:32 +0000 (16:03 +0000)]
What's new.

13 years agoIn some cases, we could end up with a mirrored LV without a MIRRORED flag. In
Petr Rockai [Thu, 24 Mar 2011 12:28:02 +0000 (12:28 +0000)]
In some cases, we could end up with a mirrored LV without a MIRRORED flag. In
other cases, the code could wind up removing wrong number of mirrors. In yet
other cases, we could remove the right number of mirrors, but fail to respect
the removal preferences (i.e. keep an image that was requested to be removed
while removing an image that was requested to be kept). Under some
circumstances, remove_mirror_images could also get stuck in an infinite loop.

This patch should fix all of the above undesirable behaviours.

Signed-off-by: Petr Rockai <prockai@redhat.com>
Reviewed-by: Jonathan Brassow <jbrassow@redhat.com>
13 years agoRelease allocated memory on closedown
Zdenek Kabelac [Thu, 24 Mar 2011 10:45:00 +0000 (10:45 +0000)]
Release allocated memory on closedown

Release allocated buffers before exit() in debug singlenode - so it's not
poping out in valgrind as memory leak.

13 years agoFix last checkin - added error message text wrong.
Alasdair Kergon [Sun, 20 Mar 2011 02:00:52 +0000 (02:00 +0000)]
Fix last checkin - added error message text wrong.

13 years agoImprove debug stack trace
Zdenek Kabelac [Fri, 18 Mar 2011 13:21:02 +0000 (13:21 +0000)]
Improve debug stack trace

dm_check_version reports log_error() - so use return_NULL.

13 years agoMitigate some warnings if running as non-root user.
Milan Broz [Fri, 18 Mar 2011 12:17:57 +0000 (12:17 +0000)]
Mitigate some warnings if running as non-root user.

LVM doesn't behave correctly if running as non-root user,
there is warning when it detects it.

Despite this, it produces many error messages, saying nothing.
See https://bugzilla.redhat.com/show_bug.cgi?id=620571

This patch fixes two things:
1) Removes eror message from device_is_usable() which has no
information value anyway (real warning is printed inside it).

2) it fixes device-mapper initialization, if we support
core dm module autoload and device node is present, it should
fail early and not try recreate existing and correct node.
(non-root == permission denied here)

N.B. In future code should support user roles, some more
drastic checks in code are probably contraproductive now.

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