]> sourceware.org Git - lvm2.git/log
lvm2.git
15 years agoUpdate WHATS_NEW for vgremove and ORPAHN_LOCK refactoring
Dave Wysochanski [Fri, 10 Jul 2009 20:16:15 +0000 (20:16 +0000)]
Update WHATS_NEW for vgremove and ORPAHN_LOCK refactoring

15 years agoChange lock ordering of vgcfgrestore to be consistent with other tools.
Dave Wysochanski [Fri, 10 Jul 2009 20:10:18 +0000 (20:10 +0000)]
Change lock ordering of vgcfgrestore to be consistent with other tools.

Orphan lock is now obtained second and released first, and all tools
are consistent in this regard.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
15 years agoMove orphan lock obtain/release inside vg_extend().
Dave Wysochanski [Fri, 10 Jul 2009 20:09:21 +0000 (20:09 +0000)]
Move orphan lock obtain/release inside vg_extend().

With this change we now have vgcreate/vgextend liblvm functions.
Note that this changes the lock order of the following functions as the
orphan lock is now obtained first.  With our policy of non-blocking
second locks, this should not be a problem.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
15 years agoMove orphan lock inside vg_remove_single.
Dave Wysochanski [Fri, 10 Jul 2009 20:08:37 +0000 (20:08 +0000)]
Move orphan lock inside vg_remove_single.

Move the vg orphan lock inside vg_remove_single, now a complete liblvm
function.  Note that this changes the order of the locks - originally
VG_ORPHAN was obtained first, then the vgname lock.  With the current
policy of non-blocking second locks, this could mean we get a failure
obtaining the orphan lock.  In the case of a vg with lvs being removed,
this could result in the lvs being removed but not the vg.  Such a
scenario could have happened prior though with a different failure.
Other tools were examined for side-effects, and no major problems
were noted.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
15 years agoRemove force parameter from vg_remove_single, now the liblvm function.
Dave Wysochanski [Fri, 10 Jul 2009 20:07:02 +0000 (20:07 +0000)]
Remove force parameter from vg_remove_single, now the liblvm function.

Move check for active LVs outside of library function.  The vgremove
liblvm function function will fail if there are active LVs.  It will
be the application's responsibility to check this condition and remove
the LVs individually before calling vgremove.  Note also that we've
duplicated the EXPORTED_VG check in vgremove_single (tools) and
vg_remove_single (library).  Duplication seemed the only option here
since we don't want to do the automatic removal of LVs (in the tools)
if the vg is exported, and we still need to protect the library call
from removal if the vg is exported.

We still need to deal with the ORPHAN lock but vg_remove_single is now
very close to our liblvm function.

TODO: Refactor lvremove in a similar way.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
15 years agoRemove unnecessary parameters from vg_remove_single().
Dave Wysochanski [Fri, 10 Jul 2009 20:05:29 +0000 (20:05 +0000)]
Remove unnecessary parameters from vg_remove_single().

Use vg_t instead of struct volume_group.
Should be no functional change.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
15 years agoAdd dm_log_with_errno and dm_log_with_errno_init, deprecating the old
Alasdair Kergon [Fri, 10 Jul 2009 09:59:37 +0000 (09:59 +0000)]
Add dm_log_with_errno and dm_log_with_errno_init, deprecating the old
Change plog to use dm_log_with_errno unless deprecated dm_log_init was used.
Rename plog macro to LOG_LINE and use in dm_dump_memory_debug.

15 years agoCheck MD devices for a partition table during device scan.
Mike Snitzer [Thu, 9 Jul 2009 22:50:45 +0000 (22:50 +0000)]
Check MD devices for a partition table during device scan.

15 years agoAdd extended device (blkext) and MD partition (mdp) types to filters.
Mike Snitzer [Thu, 9 Jul 2009 22:34:02 +0000 (22:34 +0000)]
Add extended device (blkext) and MD partition (mdp) types to filters.

Both types were added with a 'max_partitions' of 1 because these devices
are _not_ partitionable (they are the partitions).

15 years agoFix and precise metadata read errors for segment areas.
Milan Broz [Thu, 9 Jul 2009 11:29:41 +0000 (11:29 +0000)]
Fix and precise metadata read errors for segment areas.

15 years agoFix confusing metadata syntax error messages.
Milan Broz [Thu, 9 Jul 2009 11:29:00 +0000 (11:29 +0000)]
Fix confusing metadata syntax error messages.

If there is syntax error in metadata, it now prints messages
like:
  Couldn't read 'start_extent' for segment 'extent_count'.
  Couldn't read all logical volumes for volume group vg_test.

The segment specification is wrong and confusing.

Patch fixes it by introducing "parent" member in config_node which
points to parent section and config_parent_name function, which
provides pointer to node section name.

Also it adds several LV references where possible.

15 years agoFix segment import functions to print segment name and logical volume name.
Milan Broz [Thu, 9 Jul 2009 11:28:09 +0000 (11:28 +0000)]
Fix segment import functions to print segment name and logical volume name.

15 years agoUpdate WHATS_NEW for recent vgcreate changes
Dave Wysochanski [Thu, 9 Jul 2009 10:19:07 +0000 (10:19 +0000)]
Update WHATS_NEW for recent vgcreate changes

15 years agoChange vg_create() to take only minimal parameters and obtain a lock.
Dave Wysochanski [Thu, 9 Jul 2009 10:09:33 +0000 (10:09 +0000)]
Change vg_create() to take only minimal parameters and obtain a lock.

vg_t *vg_create(struct cmd_context *cmd, const char *vg_name);
This is the first step towards the API called to create a VG.
Call vg_lock_newname() inside this function.  Use _vg_make_handle()
where possible.
Now we have 2 ways to construct a volume group:
1) vg_read: Used when constructing an existing VG from disks
2) vg_create: Used when constructing a new VG
Both of these interfaces obtain a lock, and return a vg_t *.
The usage of _vg_make_handle() inside vg_create() doesn't fit
perfectly but it's ok for now.  Needs some cleanup though and I've
noted "FIXME" in the code.

Add the new vg_create() plus vg 'set' functions for non-default
VG parameters in the following tools:
- vgcreate: Fairly straightforward refactoring.  We just moved
vg_lock_newname inside vg_create so we check the return via
vg_read_error.
- vgsplit: The refactoring here is a bit more tricky.  Originally
we called vg_lock_newname and depending on the error code, we either
read the existing vg or created the new one.  Now vg_create()
calls vg_lock_newname, so we first try to create the VG.  If this
fails with FAILED_EXIST, we can then do the vg_read.  If the
create succeeds, we check the input parameters and set any new
values on the VG.

TODO in future patches:
1. The VG_ORPHAN lock needs some thought.  We may want to treat
this as any other VG, and require the application to obtain a handle
and pass it to other API calls (for example, vg_extend).  Or,
we may find that hiding the VG_ORPHAN lock inside other APIs is
the way to go.  I thought of placing the VG_ORPHAN lock inside
vg_create() and tying it to the vg handle, but was not certain
this was the right approach.
2. Cleanup error paths. Integrate vg_read_error() with vg_create and
vg_read* error codes and/or the new error APIs.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
15 years agoAdd vg_set_alloc_policy() liblvm function and move vgchange logic inside.
Dave Wysochanski [Thu, 9 Jul 2009 10:08:54 +0000 (10:08 +0000)]
Add vg_set_alloc_policy() liblvm function and move vgchange logic inside.

NOTE: vg_set_alloc_policy() returns success if you try to set a value that
is already stored.  The behavior of vgchange is the same though - it fails.
There is a fixme noted in the code about this inconsistency, which should
be resolved if possible.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
15 years agoAdd vg_set_max_pv() liblvm function and move vgchange logic inside.
Dave Wysochanski [Thu, 9 Jul 2009 10:07:47 +0000 (10:07 +0000)]
Add vg_set_max_pv() liblvm function and move vgchange logic inside.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
15 years agoAdd vg_set_max_lv() liblvm function and move vgchange logic inside.
Dave Wysochanski [Thu, 9 Jul 2009 10:06:00 +0000 (10:06 +0000)]
Add vg_set_max_lv() liblvm function and move vgchange logic inside.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
15 years agoRename vg_change_pesize to vg_set_extent_size and use vg_t.
Dave Wysochanski [Thu, 9 Jul 2009 10:04:52 +0000 (10:04 +0000)]
Rename vg_change_pesize to vg_set_extent_size and use vg_t.

In liblvm, we will reserve the word 'change' to mean an API that
both sets one or more values, and commits to disk.  This will be
consistent with the LVM commandline.  The existing vg_change_pesize()
function does not commit to disk, but just changes the extent_size
and ensures all internal structures are updated.  This logic should
be contained in a function that sets the value.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
15 years agoRemove unused 'cmd' from vg_change_pesize().
Dave Wysochanski [Thu, 9 Jul 2009 10:03:37 +0000 (10:03 +0000)]
Remove unused 'cmd' from vg_change_pesize().

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
15 years agoUpdate vg_change_pesize() to contain all validity checks.
Dave Wysochanski [Thu, 9 Jul 2009 10:02:15 +0000 (10:02 +0000)]
Update vg_change_pesize() to contain all validity checks.

It would be nice to have one function that does all the validation
and setting of the VG's pesize.  However, currently some checks
are in the higher-level function _vgchange_pesize(), and some
checks are in the lower function vg_change_pesize().
This patch moves most of the higher-level checks inside
vg_change_pesize.  In one case a failure return code is
changed from ECMD_FAILED to EINVALID_CMD_LINE.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
15 years agoAdd defines for default vgcreate parameters.
Dave Wysochanski [Thu, 9 Jul 2009 10:00:36 +0000 (10:00 +0000)]
Add defines for default vgcreate parameters.

15 years agoUpdate t-vgcreate-usage.sh to check for default vg properties.
Dave Wysochanski [Thu, 9 Jul 2009 08:50:55 +0000 (08:50 +0000)]
Update t-vgcreate-usage.sh to check for default vg properties.

15 years agoFix memory leak in vgsplit when re-reading the VG.
Dave Wysochanski [Thu, 9 Jul 2009 05:40:59 +0000 (05:40 +0000)]
Fix memory leak in vgsplit when re-reading the VG.

Call vg_release() before re-reading the vg.
Remove vgsplit whitespace and update copyright.

Author: Dave Wysochanski <dwysocha@redhat.com>

15 years ago.
Dave Wysochanski [Wed, 8 Jul 2009 22:22:12 +0000 (22:22 +0000)]
.

15 years agoMake exit paths more robust when some init function fails.
Dave Wysochanski [Wed, 8 Jul 2009 22:18:32 +0000 (22:18 +0000)]
Make exit paths more robust when some init function fails.

Author: Dave Wysochanski <dwysocha@redhat.com>

15 years agoRefactor a couple log_error() statements in prep for larger log_error() patch.
Dave Wysochanski [Wed, 8 Jul 2009 18:15:51 +0000 (18:15 +0000)]
Refactor a couple log_error() statements in prep for larger log_error() patch.

Part of twoerner's log_error() patches.

Signed-off-by: Thomas Woerner <twoerner@redhat.com>
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
15 years agoAdd t-lvm-init.sh - test lvm init routines and error paths.
Dave Wysochanski [Wed, 8 Jul 2009 18:14:47 +0000 (18:14 +0000)]
Add t-lvm-init.sh - test lvm init routines and error paths.

15 years agoFix segfault in persistent_filter_dump() if lvm init fails.
Dave Wysochanski [Wed, 8 Jul 2009 18:13:32 +0000 (18:13 +0000)]
Fix segfault in persistent_filter_dump() if lvm init fails.

Just return_0 in persistent_filter_dump() if passed a NULL filter;

15 years agoMake destroy_toolcontext() better able to handle NULL pointers.
Dave Wysochanski [Wed, 8 Jul 2009 18:12:08 +0000 (18:12 +0000)]
Make destroy_toolcontext() better able to handle NULL pointers.

Part of twoerner's log_error() patches.

Signed-off-by: Thomas Woerner <twoerner@redhat.com>
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
15 years agoUpdate WHATS_NEW for vgread cleanup
Dave Wysochanski [Wed, 8 Jul 2009 14:41:00 +0000 (14:41 +0000)]
Update WHATS_NEW for vgread cleanup

15 years agoRemove unneeded LOCK_NONBLOCKING from vg_read() API.
Dave Wysochanski [Wed, 8 Jul 2009 14:33:17 +0000 (14:33 +0000)]
Remove unneeded LOCK_NONBLOCKING from vg_read() API.

Remove unneeded LOCK_NONBLOCKING from vg_read() API and tools that
use it.  We no longer need this flag anywhere since we now automatically
set LCK_NONBLOCK inside lock_vol() if vgs_locked().
For further details, see:
commit d52b3fd3fe2006e2d13e42f8518b6512bff03710
Author: Dave Wysochanski <dwysocha@redhat.com>
Date:   Wed May 13 13:02:52 2009 +0000

    Remove NON_BLOCKING lock flag from tools and set a policy to auto-set.

    As a simplification to the tools and further liblvm, this patch pushes
    the setting of NON_BLOCKING lock flag inside the lock_vol() call.
    The policy we set is if any existing VGs are currently locked, we
    set the NON_BLOCKING flag.

At some point it may make sense to add this flag back if we get an
RFE from a liblvm user, but for now let's keep it as simple as
possible.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
15 years agoRemove READ_CHECK_EXISTENCE and vg_might_exist().
Dave Wysochanski [Wed, 8 Jul 2009 14:31:17 +0000 (14:31 +0000)]
Remove READ_CHECK_EXISTENCE and vg_might_exist().

Remove READ_CHECK_EXISTENCE and vg_might_exist().
This flag and API is no longer used now that we have a separate
API to check for existence.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
15 years agoRemove unneeded LOCK_KEEP from vg_read() interface.
Dave Wysochanski [Wed, 8 Jul 2009 14:28:30 +0000 (14:28 +0000)]
Remove unneeded LOCK_KEEP from vg_read() interface.

Remove unneeded LOCK_KEEP from vg_read() interface.
Update comment to clarify cases where _vg_lock_and_read() may return
with an error but the lock held.  Would be nice to make the vg_read()
interface consistent with regards to lock held and error behavior.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
15 years agoRemove LOCK_KEEP and READ_CHECK_EXISTENCE from vgsplit.
Dave Wysochanski [Wed, 8 Jul 2009 14:27:37 +0000 (14:27 +0000)]
Remove LOCK_KEEP and READ_CHECK_EXISTENCE from vgsplit.

Remove LOCK_KEEP and READ_CHECK_EXISTENCE from vgsplit.
These flags are no longer necessary.  We now check for existence
in a differnet function, and it is not necessary to keep the lock.
Removing these flags simplifies the new vg_read() interface.
After this patch, we can fully remove LOCK_KEEP.
READ_CHECK_EXISTENCE needs a bit more work before full removal.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
15 years agoPermit several segment types to be registered by a single shared object.
Alasdair Kergon [Wed, 8 Jul 2009 12:36:01 +0000 (12:36 +0000)]
Permit several segment types to be registered by a single shared object.

15 years agoContinue to make --units and --size consistent (in code and man pages):
Mike Snitzer [Tue, 7 Jul 2009 19:28:57 +0000 (19:28 +0000)]
Continue to make --units and --size consistent (in code and man pages):

Update units_to_bytes() to support (S)ectors: 500 bytes.
- 500 byte (S)ectors is of questionable value but it adds to consistency
  if a user happens to use --units S.  This seems better than an error.

Updated test/t-covercmd.sh to test --units [hS]

Document the units that can be displayed via --units uniformly.
- (p)etabytes and (e)xabytes were missing in pvs, vgs and lvs man pages.

Made lvreduce man page "... in units of megabytes." consistent (with the
lvextend and lvresize man pages).

15 years ago.
Alasdair Kergon [Tue, 7 Jul 2009 17:19:38 +0000 (17:19 +0000)]
.

15 years agoFix whitespace in linear target line to fix identical table line detection.
Alasdair Kergon [Tue, 7 Jul 2009 16:36:05 +0000 (16:36 +0000)]
Fix whitespace in linear target line to fix identical table line detection.
(only tested with linear so far)

15 years agoFix compile warning in lvmcmdline.c - use C99 PRIu64 for uint64_t.
Dave Wysochanski [Tue, 7 Jul 2009 01:51:00 +0000 (01:51 +0000)]
Fix compile warning in lvmcmdline.c - use C99 PRIu64 for uint64_t.

Author: Dave Wysochanski <dwysocha@redhat.com>

15 years agoFix vg_read() error paths to properly release upon vg_read_error().
Dave Wysochanski [Tue, 7 Jul 2009 01:18:35 +0000 (01:18 +0000)]
Fix vg_read() error paths to properly release upon vg_read_error().

Fix vg_read() error paths to properly release upon vg_read_error().
Note that in the iterator paths (process_each_*()), we release
inside the iterator so no individual cleanup is needed.  However there
are a number of other places we missed the cleanup.  Proper cleanup
when vg_read_error() is true should be calling vg_release(vg), since
there should be no locks held if we get an error (except in certain
special cases, which IMO we should work to remove from the code).

Unfortunately the testsuite is unable to detect these types of memory
leaks.  Most of them can be easily seen if you try an operation
(e.g. lvcreate) with a volume group that does not exist.  Error
message looks like this:
  Volume group "vg2" not found
  You have a memory leak (not released memory pool):
   [0x1975eb8]
  You have a memory leak (not released memory pool):
   [0x1975eb8]

Author: Dave Wysochanski <dwysocha@redhat.com>

15 years agoReword the WHATS_NEW commandline sizes update.
Mike Snitzer [Mon, 6 Jul 2009 19:17:15 +0000 (19:17 +0000)]
Reword the WHATS_NEW commandline sizes update.

15 years agoAllow commandline sizes to be specified in terms of bytes and sectors.
Mike Snitzer [Mon, 6 Jul 2009 19:13:26 +0000 (19:13 +0000)]
Allow commandline sizes to be specified in terms of bytes and sectors.
Update the man pages to document size units uniformly.

15 years agoUse the MD device's stripe-width, instead of chunk_size, to align the
Mike Snitzer [Mon, 6 Jul 2009 19:04:24 +0000 (19:04 +0000)]
Use the MD device's stripe-width, instead of chunk_size, to align the
data blocks of a Physical Volume that is placed directly upon an MD
device.

15 years agoAdd device number to more log messages during activation.
Alasdair Kergon [Fri, 3 Jul 2009 12:45:55 +0000 (12:45 +0000)]
Add device number to more log messages during activation.

15 years agoclarification
Alasdair Kergon [Fri, 3 Jul 2009 11:04:06 +0000 (11:04 +0000)]
clarification

15 years agoUpdate WHATS_NEW for vg_read commits
Dave Wysochanski [Wed, 1 Jul 2009 17:23:10 +0000 (17:23 +0000)]
Update WHATS_NEW for vg_read commits

15 years agoFix t-inconsistent-metadata.sh.
Dave Wysochanski [Wed, 1 Jul 2009 17:06:04 +0000 (17:06 +0000)]
Fix t-inconsistent-metadata.sh.

Sun May  3 13:25:10 CEST 2009  Petr Rockai <me@mornfall.net>
  * All tools now handle inconsistent metadata the same way.

Rebase 6/26/09

15 years agoAdd lvmcache_init() to polldaemon initialization.
Dave Wysochanski [Wed, 1 Jul 2009 17:05:12 +0000 (17:05 +0000)]
Add lvmcache_init() to polldaemon initialization.

Signed-off-by: Petr Rockai <me@mornfall.net>
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
15 years agoConvert vgsplit to use vg_read_for_update.
Dave Wysochanski [Wed, 1 Jul 2009 17:04:21 +0000 (17:04 +0000)]
Convert vgsplit to use vg_read_for_update.

Sun May  3 13:12:28 CEST 2009  Petr Rockai <me@mornfall.net>
  * Convert vgsplit to use vg_read_for_update.

Author: Petr Rockai <prockai@redhat.com>
Committer: Dave Wysochanski <dwysocha@redhat.com>

15 years agoDon't segfault in vg_release when vg->cmd is NULL.
Dave Wysochanski [Wed, 1 Jul 2009 17:03:38 +0000 (17:03 +0000)]
Don't segfault in vg_release when vg->cmd is NULL.

Sun May  3 13:06:14 CEST 2009  Petr Rockai <me@mornfall.net>
  * Don't segfault in vg_release when vg->cmd is NULL.

Author: Petr Rockai <prockai@redhat.com>
Committer: Dave Wysochanski <dwysocha@redhat.com>

15 years agoConvert vgrename to vg_read_for_update.
Dave Wysochanski [Wed, 1 Jul 2009 17:02:18 +0000 (17:02 +0000)]
Convert vgrename to vg_read_for_update.

Sun May  3 12:54:28 CEST 2009  Petr Rockai <me@mornfall.net>
  * Convert vgrename to vg_read_for_update.

Rebased 6/26/2009 - Dave W.

Author: Petr Rockai <prockai@redhat.com>
Committer: Dave Wysochanski <dwysocha@redhat.com>

15 years agoConvert vgreduce to use vg_read_for_update.
Dave Wysochanski [Wed, 1 Jul 2009 17:01:46 +0000 (17:01 +0000)]
Convert vgreduce to use vg_read_for_update.

Sun May  3 12:50:58 CEST 2009  Petr Rockai <me@mornfall.net>
  * Convert vgreduce to use vg_read_for_update.

Rebased 6/26/2009 - Dave W.

15 years agoRework the toollib interface (process_each_*) on top of new vg_read.
Dave Wysochanski [Wed, 1 Jul 2009 17:00:50 +0000 (17:00 +0000)]
Rework the toollib interface (process_each_*) on top of new vg_read.

Sun May  3 12:32:30 CEST 2009  Petr Rockai <me@mornfall.net>
  * Rework the toollib interface (process_each_*) on top of new vg_read.

Rebased 6/26/09 by Dave W.
- Add skipping message to process_each_lv
- Remove inconsistent_t.

15 years agoConvert the straight instances of vg_lock_and_read to new vg_read(_for_update).
Dave Wysochanski [Wed, 1 Jul 2009 16:59:37 +0000 (16:59 +0000)]
Convert the straight instances of vg_lock_and_read to new vg_read(_for_update).

Sun May  3 11:40:51 CEST 2009  Petr Rockai <me@mornfall.net>
  * Convert the straight instances of vg_lock_and_read to new vg_read(_for_update).

Rebased 6/26/09 by Dave W.

15 years agopost-release
Alasdair Kergon [Wed, 1 Jul 2009 09:31:46 +0000 (09:31 +0000)]
post-release

15 years agoupdate date
Alasdair Kergon [Tue, 30 Jun 2009 18:41:47 +0000 (18:41 +0000)]
update date

15 years agopre-release tidy up
Alasdair Kergon [Tue, 30 Jun 2009 18:39:31 +0000 (18:39 +0000)]
pre-release tidy up

15 years agoFix incomplete revert for lvconvert.
Dave Wysochanski [Fri, 26 Jun 2009 11:29:06 +0000 (11:29 +0000)]
Fix incomplete revert for lvconvert.

15 years agopre-release
Alasdair Kergon [Fri, 26 Jun 2009 10:57:30 +0000 (10:57 +0000)]
pre-release

15 years agorevert last patch - let's do a release first
Alasdair Kergon [Fri, 26 Jun 2009 10:55:57 +0000 (10:55 +0000)]
revert last patch - let's do a release first

15 years agoConvert the straight instances of vg_lock_and_read to new vg_read(_for_update).
Dave Wysochanski [Fri, 26 Jun 2009 09:47:36 +0000 (09:47 +0000)]
Convert the straight instances of vg_lock_and_read to new vg_read(_for_update).

Sun May  3 11:40:51 CEST 2009  Petr Rockai <me@mornfall.net>
  * Convert the straight instances of vg_lock_and_read to new vg_read(_for_update).

Author: Petr Rockai <prockai@redhat.com>
Committer: Dave Wysochanski <dwysocha@redhat.com>

15 years agoAbort if automatic metadata correction fails when reading VG to update it.
Alasdair Kergon [Fri, 26 Jun 2009 09:19:13 +0000 (09:19 +0000)]
Abort if automatic metadata correction fails when reading VG to update it.

15 years agoAbort operation if automatic metadata correction in lvconvert fails.
Alasdair Kergon [Fri, 26 Jun 2009 09:03:59 +0000 (09:03 +0000)]
Abort operation if automatic metadata correction in lvconvert fails.

15 years agoFix backward compatibility for major:minor query.
Milan Broz [Wed, 17 Jun 2009 20:55:24 +0000 (20:55 +0000)]
Fix backward compatibility for major:minor query.

Is an application uses query and set major:minor
to device, it should not fallback to default major by default.

Add new function whoich allows that (and use it in lvm2).

15 years agoProperly destroy toolcontext.
Milan Broz [Wed, 17 Jun 2009 20:54:20 +0000 (20:54 +0000)]
Properly destroy toolcontext.

(fixes previous commit)

15 years agoVarious vgimportclone fixes:
Mike Snitzer [Wed, 17 Jun 2009 15:47:01 +0000 (15:47 +0000)]
Various vgimportclone fixes:
- validate the specified device is a PV and that it is in a VG
- automatically enable DEBUG (-d) if >= 4 -v instances were supplied
- preserve TMP_LVM_SYSTEM_DIR if it contains an lvm.conf and -d was
  specified
- fix handling of special-case where PV is listed as "unknown device"
- more descriptive error when a PV is missing ("unknown device")
- unset LVM_SYSTEM_DIR if it was not originally set
- skip final vgscan if no changes were made

15 years agoCleanup pvs, vgs, and lvs "-o" section in man pages (rhbz 500861).
Dave Wysochanski [Mon, 15 Jun 2009 17:09:32 +0000 (17:09 +0000)]
Cleanup pvs, vgs, and lvs "-o" section in man pages (rhbz 500861).

http://bugzilla.redhat.com/show_bug.cgi?id=500861
- Update list of fields/columns for each command (a few missing).
- Update list order to match "-o help" output (easier to verify field list)
- Add "{pv|vg|lv}_all" description.
- Move "-o help" sentence above column/field list.

New sample man page for lvs (pvs and vgs are similar):
       -o, --options
              Comma-separated ordered list of columns.  Precede the list  with  ’+’  to  append  to  the
              default selection of columns instead of replacing it.

              Use  -o  lv_all to select all logical volume columns, and -o seg_all to select all logical
              segment columns.

              Use -o help to view the full list of columns available.

              Column names  include:  lv_uuid,  lv_name,  lv_attr,  lv_major,  lv_minor,  lv_read_ahead,
              lv_kernel_major,  lv_kernel_minor,  lv_kernel_read_ahead, lv_size, seg_count, origin, ori-
              gin_size, snap_percent, copy_percent, move_pv, convert_lv, lv_tags,  mirror_log,  modules,
              segtype,  stripes,  stripesize,  regionsize, chunksize, seg_start, seg_start_pe, seg_size,
              seg_tags, seg_pe_ranges, devices.

              With --segments, any "seg_" prefixes  are  optional;  otherwise  any  "lv_"  prefixes  are
              optional.  Columns mentioned in vgs (8) can also be chosen.

              The lv_attr bits are:

15 years agoAdd WHATS_NEW items.
Milan Broz [Mon, 15 Jun 2009 15:09:02 +0000 (15:09 +0000)]
Add WHATS_NEW items.

15 years ago- Ignore suspended devices during repair (Milan).
Petr Rockai [Mon, 15 Jun 2009 14:47:39 +0000 (14:47 +0000)]
- Ignore suspended devices during repair (Milan).
- Call vgreduce --removemissing (without --force) automatically to clean up bad
  PVs (Milan).

15 years agoSuggest use lvchange --resync when up converting not yet synced mirror.
Milan Broz [Mon, 15 Jun 2009 13:43:15 +0000 (13:43 +0000)]
Suggest use lvchange --resync when up converting not yet synced mirror.

15 years agoDo not fork daemon when dmeventd cannot be found.
Milan Broz [Mon, 15 Jun 2009 12:29:41 +0000 (12:29 +0000)]
Do not fork daemon when dmeventd cannot be found.

15 years agoDestroy toolcontext on exit in clvmd (fixes memory pool leaks).
Milan Broz [Mon, 15 Jun 2009 12:15:23 +0000 (12:15 +0000)]
Destroy toolcontext on exit in clvmd (fixes memory pool leaks).

15 years agoFix lvconvert to not poll mirror if no conversion in progress.
Milan Broz [Mon, 15 Jun 2009 12:08:59 +0000 (12:08 +0000)]
Fix lvconvert to not poll mirror if no conversion in progress.

15 years agoFix memory leaks in toolcontext error path.
Milan Broz [Mon, 15 Jun 2009 11:56:31 +0000 (11:56 +0000)]
Fix memory leaks in toolcontext error path.

E.g.
 # vgscan
  Parse error at byte 2360 (line 54): expected a value
  Failed to load config file /etc/lvm/lvm.conf
You have a memory leak (not released memory pool):
 [0x818c788] library (12 bytes)

...

15 years agoFix WHATS_NEW - Allow metadata correction even when PVs are missing.
Milan Broz [Fri, 12 Jun 2009 08:34:15 +0000 (08:34 +0000)]
Fix WHATS_NEW - Allow metadata correction even when PVs are missing.

15 years agoRe-instate partial activation support in clustered mode. (mornfall)
Milan Broz [Fri, 12 Jun 2009 08:30:19 +0000 (08:30 +0000)]
Re-instate partial activation support in clustered mode. (mornfall)

15 years agoAllow metadata correction even when PVs are missing.
Petr Rockai [Wed, 10 Jun 2009 20:17:32 +0000 (20:17 +0000)]
Allow metadata correction even when PVs are missing.

15 years agoIn the new _vg_read_for_update(), we always do the check for CLUSTERED vg
Dave Wysochanski [Wed, 10 Jun 2009 16:14:40 +0000 (16:14 +0000)]
In the new _vg_read_for_update(), we always do the check for CLUSTERED vg
status flag after reading the volume group.  Thus, no need to set the flag
in vg_read() or clear it later before calling _vg_bad_status_bits().

Also, add back in the !lockingfailed() as part of the CLUSTERED flag check.
It's unclear why it was removed when the check was moved from
_vg_bad_status_bits() to inside _vg_lock_and_read().
There was an open question about the last check in the 'if' stmt for
lockingfailed() with a previous patch submitted.  However, I would
defer that right now as it is a separate item and this patch should
be no functional change by including the !lockingfailed().

Petr acked this patch on 5/26 I just forgot to check it in.

Acked-by: Petr Rockai <prockai@redhat.com>
15 years agoComplain when lvconvert --repair is used on non-mirror LV.
Petr Rockai [Wed, 10 Jun 2009 15:27:57 +0000 (15:27 +0000)]
Complain when lvconvert --repair is used on non-mirror LV.

15 years agoFix compiler warning.
Milan Broz [Wed, 10 Jun 2009 11:21:10 +0000 (11:21 +0000)]
Fix compiler warning.

15 years agoUnlock VG in recover_vg if metadata read failed.
Milan Broz [Wed, 10 Jun 2009 11:15:29 +0000 (11:15 +0000)]
Unlock VG in recover_vg if metadata read failed.

15 years agoUnlock vg when requested automatic update failed.
Milan Broz [Wed, 10 Jun 2009 10:15:28 +0000 (10:15 +0000)]
Unlock vg when requested automatic update failed.

(fixes previous commit)

15 years agoSupport crypt segment in libdevmapper tree.
Milan Broz [Tue, 9 Jun 2009 16:10:20 +0000 (16:10 +0000)]
Support crypt segment in libdevmapper tree.

- it can support multiple segments, but note that
to work properly, correct IV (initialization vector)
offset parameter must be set properly.

Because most usage of IV start offset is when we join
several crypto segments together (so iv_offset is the segment
start offset), DM_CRYPT_IV_DEFAULT is defined to simplify
the process.

Function accepts the string in cipher agrument (already
including chainmode and iv type; chainmode and iv parameters are NULL
in this case) or user can provide split parameters which will
join into dm-crypt cipher specification "cipher-chainmode-iv".

All these parameters must be supplied in correct dm-crypt format.

15 years agoUse 'lvm lvresize' instead of 'lvresize' in fsadm.
Zdenek Kabelac [Tue, 9 Jun 2009 15:31:36 +0000 (15:31 +0000)]
Use 'lvm lvresize' instead of 'lvresize' in fsadm.
Do not use '-n' realine option in fsadm for busybox compatiblity.

15 years agoUpdate WHATS_NEW
Dave Wysochanski [Tue, 9 Jun 2009 14:43:59 +0000 (14:43 +0000)]
Update WHATS_NEW

15 years agoUpdate vgsplit to use new vg_reserve_newname() function.
Dave Wysochanski [Tue, 9 Jun 2009 14:31:20 +0000 (14:31 +0000)]
Update vgsplit to use new vg_reserve_newname() function.

15 years agoUpdate vgcreate to use new vg_lock_newname().
Dave Wysochanski [Tue, 9 Jun 2009 14:30:44 +0000 (14:30 +0000)]
Update vgcreate to use new vg_lock_newname().

15 years agoUpdate vgrename to use vg_lock_newname.
Dave Wysochanski [Tue, 9 Jun 2009 14:30:16 +0000 (14:30 +0000)]
Update vgrename to use vg_lock_newname.

15 years agoAdd vg_lock_newname() library function.
Dave Wysochanski [Tue, 9 Jun 2009 14:29:10 +0000 (14:29 +0000)]
Add vg_lock_newname() library function.

Various tools need to check for existence of a VG before doing something
(vgsplit, vgrename, vgcreate).  Currently we don't have an interface to
check for existence, but the existence check is part of the vg_read* call(s).
This patch is an attempt to pull out some of that functionality into a
separate function, and hopefully simplify our vg_read interface, and
move those patches along.

vg_lock_newname() is only concerned about checking whether a vg exists in
the system.  Unfortunately, we cannot just scan the system, but we must first
obtain a lock.  Since we are reserving a vgname, we take a WRITE lock on
the vgname.  Once obtained, we scan the system to ensure the name does
not exist.  The return codes and behavior is in the function header.
You might think of this function as similar to an open() call with
O_CREAT and O_EXCL flags (returns failure with -EEXIST if file already
exists).

NOTE: I think including the word "lock" in the function name is important,
as it clearly states the function obtains a lock and makes the code more
readable, especially when it comes to cleanup / unlocking.  The ultimate
function name is somewhat open for debate though so later we may rename.

15 years agoFix the same readahead rounding in lvcreate.
Milan Broz [Sat, 6 Jun 2009 22:06:54 +0000 (22:06 +0000)]
Fix the same readahead rounding in lvcreate.

(fixes previous commit)

15 years agoRound readahead more inteligently and print warning.
Milan Broz [Sat, 6 Jun 2009 22:00:20 +0000 (22:00 +0000)]
Round readahead more inteligently and print warning.

Round readahead at least to one page up.
Print warning instead of verbose message.

15 years agoFix various problems in tests
Milan Broz [Sat, 6 Jun 2009 16:40:39 +0000 (16:40 +0000)]
Fix various problems in tests

- PPC uses 64k page, some caculations are wrong in tests
- file utility is buggy on PPC and cannot detect swap, use blkid instead
- read ahead is quietly rounded down according to page size
(for now use some common divisor value in test)

15 years agoSuspend virtual origin before real snapshot.
Milan Broz [Sat, 6 Jun 2009 16:37:15 +0000 (16:37 +0000)]
Suspend virtual origin before real snapshot.

Because preload of table for snapshot can produce snapshot
metadata (in kernel cow header) read.

Code should suspend origin first to avoid possible deadlock
when preloading (thus calling snapshot in-kernel constructor)
for origin with suspended cow device.

(fixes previous commit)

15 years agoFix double releasing of vg when repairing of vg is requested.
Milan Broz [Fri, 5 Jun 2009 20:00:52 +0000 (20:00 +0000)]
Fix double releasing of vg when repairing of vg is requested.

Several commands calls process_each_vg() and in provided
callback it explicitly recovers VG if inconsistent.
(vgchange, vgconvert, vgscan)

It means that old VG is released and reread  but the function
above (process_one_vg) tries to unlock and release old VG.

Patch moves the repair logic into _process_one_vg() function.

It always tries to read vg (even inconsistent) and then decides
what to do according new defined parameter.

Also patch unifies inconsistent error messages.

The only slight change if for vgremove command, where
it now tries to repair VG before it removes if force arg is given.
(It works similar way before, just the order of operation changed).

15 years agoAdd vgrename test to check for existence of new vg.
Dave Wysochanski [Fri, 5 Jun 2009 10:42:22 +0000 (10:42 +0000)]
Add vgrename test to check for existence of new vg.

15 years agotest commit
Alasdair Kergon [Thu, 4 Jun 2009 13:23:10 +0000 (13:23 +0000)]
test commit

15 years agotest commit
Alasdair Kergon [Thu, 4 Jun 2009 13:16:49 +0000 (13:16 +0000)]
test commit

15 years agotest commit
Alasdair Kergon [Thu, 4 Jun 2009 13:11:58 +0000 (13:11 +0000)]
test commit

15 years agoUse lvconvert --repair instead of vgreduce in mirror dmeventd DSO (mornfall)
Milan Broz [Thu, 4 Jun 2009 12:01:15 +0000 (12:01 +0000)]
Use lvconvert --repair instead of vgreduce in mirror dmeventd DSO (mornfall)
Introduce lvconvert --use_policies (mornfall)

15 years agoAdd splitname.
Alasdair Kergon [Wed, 3 Jun 2009 20:44:42 +0000 (20:44 +0000)]
Add splitname.

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