summaryrefslogtreecommitdiffstats
path: root/tools/pvmove.c
Commit message (Collapse)AuthorAgeFilesLines
* Fail early if cmirror is not detected and pvmove requires it.Milan Broz2012-03-271-1/+9
|
* Also skip pvmove for remotely active LVs.Milan Broz2012-03-271-0/+8
|
* Keep exclusive activation in pvmove if LV is already active.Milan Broz2012-03-261-1/+1
| | | | | | | Pvmove should never try to downgrade exclusive lock for LVs. This allows pvmove to work again for exclusive activated LVs.
* Do not allow pvmove if some affected LVs are activatedMilan Broz2012-03-261-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | locally or on more nodes while others are activated exclusively. Current pvmove code can either use local mirror (for exclusive activation) or cmirror (for clustered LVs). Because the whole intenal pvmove LV is just segmented LV containing segments of several top-level LVs, code cannot properly handle situation if some segment need to be activated exclusively. Previously, it wrongly activated exclusive LV on all nodes (locing code allowed it) but now this is no lnger possible. If there is exclusively activated LV, pvmove is only possible if all affected LVs are aslo activated exclusively. (Note that in non-exclusive mode pvmove still activates LVs on other nodes during move.) # lvchange -aly vg_test/lv1 # lvchange -aey vg_test/lv2 # pvmove -i 1 /dev/sdc Error locking on node bar-01: Device or resource busy Error locking on node bar-03: Volume is busy on another node ... Failed to activate lv2
* Use new flag PVMOVE_EXCLUSIVE in update_metatada call.Milan Broz2012-03-261-5/+11
| | | | | | | There is no real functional change in this patch except it avoids checking cluster cmirror module twice. (Flag used in following patch.)
* Fix error message when pvmove LV activation fails with name already in use.Alasdair Kergon2012-03-131-1/+1
|
* Using enum types for enumsZdenek Kabelac2012-02-281-1/+1
| | | | alloc_policy_t, dm_string_mangling_t, percent_range_t, sign_t
* reinstate !first_time checkAlasdair Kergon2011-12-081-2/+2
| | | | (recovery from first_time failure would need different code)
* Remove test for first_time with FIXMEZdenek Kabelac2011-10-111-2/+3
| | | | | | | Workaround for the current code with big FIXME, since proper solution for pvmove needs to be developed. Commiting this only for the purpose to get cluster testing covered.
* Introduce revert_lv for better pvmove cleanup.Alasdair Kergon2011-09-271-5/+15
| | | | (One further fix needed to remove the stray pvmove LVs left behind.)
* Replace incomplete pvmove activation failure recovery code with a message.Alasdair Kergon2011-09-271-15/+2
| | | | | As it stands, the recovery code can make things worse sometimes so it's better to insist on a proper 'pvmove --abort' cleanup.
* Abort if _finish_pvmove suspend_lvs fails instead of cleaning up incompletely.Alasdair Kergon2011-09-271-12/+13
| | | | | Change suspend_lvs to call vg_revert internally. Change vg_revert to void and remove superfluous calls after failed vg_commit.
* FIXMEs to note problems with some error paths. (Perhaps safer to disableAlasdair Kergon2011-09-211-0/+4
| | | | them until they can be fixed completely?)
* Move the core of the lib/config/config.c functionality into libdevmapper,Petr Rockai2011-08-301-1/+1
| | | | | | | leaving behind the LVM-specific parts of the code (convenience wrappers that handle `struct device` and `struct cmd_context`, basically). A number of functions have been renamed (in addition to getting a dm_ prefix) -- namely, all of the config interface now has a dm_config_ prefix.
* Replace free_vg with release_vgZdenek Kabelac2011-08-101-2/+2
| | | | | | | | Move the free_vg() to vg.c and replace free_vg with release_vg and make the _free_vg internal. Patch is needed for sharing VG in vginfo cache so the release_vg function name is a better fit here.
* Major pvmove fix to issue ioctls in the correct order when multiple LVsAlasdair Kergon2011-06-111-46/+54
| | | | | | | | | | | are affected by the move. (Currently it's possible for I/O to become trapped between suspended devices amongst other problems. The current fix was selected so as to minimise the testing surface. I hope eventually to replace it with a cleaner one that extends the deptree code. Some lvconvert scenarios still suffer from related problems.
* Remove double bracesZdenek Kabelac2011-03-291-2/+2
| | | | | Clang gives notice about possible confusion as commonly double bracces are used when some assignment is done inside them.
* Add new free_pv_fid fn and use it throughout to free all attached fids.Peter Rajnoha2011-03-111-1/+8
| | | | | | | | Since format instances will use own memory pool, it's necessary to properly deallocate it. For now, only fid is deallocated. The PV structure itself still uses cmd mempool mostly, but anytime we'd like to add a mempool in the struct physical_volume, we can just rename this fn to free_pv and add the code (like we have free_vg fn for VGs).
* Rename vg_release to free_vg.Alasdair Kergon2010-12-081-2/+2
|
* Add escape sequence for ':' and '@' found in device names used as PVs.Peter Rajnoha2010-09-231-9/+8
|
* Fix pvmove --abort to work even for empty pvmove LVMilan Broz2010-08-231-1/+2
| | | | | | | | | | | If pvmove crashed and metadata contains pvmove LV but without miorrored segments, pvmove --abort will not repair the situation (and finish wth success!). Fix it by allowing metadata update if aborting (thus removing pvmove LV) even if no moved LVs detected. (Tested on real metadata provided by an lvm user:-)
* Use __attribute__ consistently throughout.Alasdair Kergon2010-07-091-1/+1
|
* Account for mirror transient status when doing lvconvert --repair.Petr Rockai2010-05-241-1/+1
|
* Permit mimage LVs to be striped in lvcreate and lvresize.Alasdair Kergon2010-04-091-1/+1
|
* Prepare for _get_lvconvert_vg() reuse as part of a larger lvconvert.cMike Snitzer2010-02-051-1/+2
| | | | | | | | | | refactoring. Document the need to cleanup the "name" args passed around polldaemon, lvconvert and pvmove. It is quite a mess. Annotate the unused nature of the existing poll_fns->get_copy_vg methods' 'uuid' arg.
* Fix pvmove abort when temporary mirror fails to be cluster-aware.Milan Broz2010-01-271-16/+38
| | | | | | | | | | | | | | | When activation of pvmove mirror fails on cluster, some nodes still possibly succeeded in activation. - Explicitly deactivate that mirror to be sure - properly pair suspend/resume calls to not cause memory lock problems in clvmd Code cannot simply call _finish_pvmove on cluster in this situation, because changed LVs are suspended twice (causing memory inbalance) and also temporary mirror is activated when it is not expected (and we know that it failed already). Patch prepares special function which remove temporary mirror references from metadata and then resumes changed LVs.
* Add some missing vg_revrts calls when pvmove aborts.Milan Broz2010-01-261-1/+4
|
* Add missing 'stack;' for all activate_lv and deactivate_lv callers.Mike Snitzer2010-01-051-2/+9
| | | | Signed-off-by: Mike Snitzer <snitzer@redhat.com>
* Add missing 'stack;' for all suspend_lv and resume_lv callers.Mike Snitzer2010-01-051-7/+14
| | | | Signed-off-by: Mike Snitzer <snitzer@redhat.com>
* Give better message for pvmove when all data on source PV is skipped.Peter Rajnoha2009-12-041-0/+10
|
* Fix pvmove test mode to not fail and do not poll.Milan Broz2009-12-031-1/+6
| | | | Test mode should not fail nor try to poll non-existent devices.
* Tidy some uses of arg_count and introduce arg_is_set.Alasdair Kergon2009-11-031-2/+1
|
* Make poll_mirror_progress a function that can be replaced.Alasdair Kergon2009-09-301-0/+1
|
* Refactor a couple log_error() statements in prep for larger log_error() patch.Dave Wysochanski2009-07-081-4/+2
| | | | | | | Part of twoerner's log_error() patches. Signed-off-by: Thomas Woerner <twoerner@redhat.com> Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
* Fix vg_read() error paths to properly release upon vg_read_error().Dave Wysochanski2009-07-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | 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>
* Convert the straight instances of vg_lock_and_read to new vg_read(_for_update).Dave Wysochanski2009-07-011-9/+3
| | | | | | | 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.
* revert last patch - let's do a release firstAlasdair Kergon2009-06-261-3/+9
|
* Convert the straight instances of vg_lock_and_read to new vg_read(_for_update).Dave Wysochanski2009-06-261-9/+3
| | | | | | | | | 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>
* Fix convert polling to ignore LV with different UUID.Milan Broz2009-06-011-2/+2
| | | | | | | | | | | | | | | | | | | When mirror convert polling is started (mainly as backgound process, in lvchange -a y or in lvconvert itself) it tries to read VG and LV identified by its name. Unfortunatelly, the VG can have already different LV under the same name, and various more or less funny things can happen (note that _finish_lvconvert_mirror suspends the volume for example). (the typical example is our testing script which continuously recreates LVs under the same name in the same VG.) This patch adds optional uuid parameter which helps to properly select the monitoring object. For lvconvert polling it is set to LV UUID and both _get_lvconvert_vg and _get_lvconvert_lv uses it to read proper VG/LV. (In the pvmove case it is NULL, here we poll for physical volume name).
* Pre-release cleanups.Alasdair Kergon2009-05-211-1/+1
|
* If pvmove fails activating mirror volume, try restore to previous state.Milan Broz2009-05-191-6/+14
| | | | | | | pvmove now keep suspended devices if temporary mirror creation fails. We can try to restore previous state if it is first attempt to activate pvmove (code basically run the same code as --abort automatically).
* Remove unneeded import parameter from lv_create_empty.Milan Broz2009-05-131-1/+1
|
* Move metadata backup call after vg_commit.Milan Broz2009-04-211-10/+11
| | | | | | | | | | | | The backup() call store metadata from memory. But in cluster backup() call performs remote nodes metadata backup and it reads data from disk. For metadata backup consistency, patch moves all backup() calls after vg_commit. (Moreover, some tools already do that this way.)
* Properly release VG memory pool in all CLI tools.Milan Broz2009-04-101-37/+19
|
* Fix last check-ins: seg can be NULL.Alasdair Kergon2009-02-281-1/+1
|
* Right, a simple build (without options) is working again.Alasdair Kergon2008-11-031-23/+23
|
* Add vg_is_clustered() helper function.Dave Wysochanski2008-04-101-1/+1
| | | | Should be no functional change.
* Use clustered mirror log with pvmove in clustered VGs, if available.Alasdair Kergon2008-04-091-20/+52
|
* Fix some pvmove error status codes.Alasdair Kergon2008-04-091-4/+5
|
* Add detection of clustered mirror log capability.Milan Broz2008-04-071-9/+25
| | | | Currently only check for kernel module presence.