summaryrefslogtreecommitdiffstats
path: root/daemons/clvmd/lvm-functions.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Never scan suspended devices in clvmd.Milan Broz2010-01-191-0/+5
| | | | | | | | | | | | For mirror repair (and similar tasks) it can happen that full device rescan is issued from clvmd. Because code can be in the middle of repair (calling suspend) clvmd should never try to scan suspended devices (otherwise it causes deadlock). Also code must not change ignore_suspended_device flag when doing refresh_filters (called from lvmcache scan code).
* Propagate commit and revert metadata event to other nodes in cluster.Milan Broz2010-01-051-2/+23
| | | | | | | | | | | | | | This patch tries to correctly track changes in lvmcache related to commit/revert. For vg_commit: if there is cached precommitted metadata, after successfull commit these metadata must be tracked as committed. For vg_revert: remote nodes must drop precommitted metadata and its flag in lvmcache. (N.B. Patch do not touch LV locks here in any way.) All this machinery is needed to properly solve remote node cache invalidaton which cause several problems recently observed.
* Add possibility to handle precommitted metadata in lvmcache.Milan Broz2010-01-051-1/+1
| | | | | | | - Add drop_precommitted flag to force drop precommitted metadata - add lvmcache_commit_metadata() which upgrades precommitted metadata in cache No functional change in this patch - just preparation for following change.
* Move processing of VG locks to separate function (similar to LV locks).Milan Broz2010-01-051-3/+14
| | | | | | And print some debugging info. No functional change in this patch.
* Properly decode flags even for VG locks.Milan Broz2010-01-051-35/+36
| | | | | | | And decode flags in humar readable form in client. And clean some trailing whitespaces. No functional change in this patch (only debugging messages changed).
* Fix missing include.Milan Broz2009-12-091-0/+1
|
* Add memlock information to do_lock_lv debug output.Milan Broz2009-12-091-3/+3
| | | | This helps a lot to detect that something strange happened.
* Never ever use distributed lock for LV in non-clustered VG.Milan Broz2009-12-091-10/+13
| | | | | | | | | | | | | | | | | | | The LV locks make sense only for clustered LVs. Properly check cluster flag and never issue cluster lock here. There are several places in code, where it is already checked, this patch add this check to all needed calls. In previous code the lock behaviour was inconsistent, for example, the pre/post callback can take lock even for local volume, but deactivate call do not released this lock and it remains held forever. The local LV lock request now just let run the underlying activation code on local node, the same process like in local locking. (Again, this is important for new mirror repair calls, here for local mirrors but with cluster locking enabled.)
* Allow implicit lock conversion for pre/post callbacks.Milan Broz2009-12-091-4/+9
| | | | | | | | | | | | | | | This is unnoticed regression from commit 31672ff60e405795cad70d6d7888ac011f5373ce The pre/post callback need to convert lock always, local node is going to modify metadata in this case, it it fails conversion, the call is ignored. Also it fixes bug when the lock is not yet held, we cannot set LKF_CONVERT in this case, it will fail because this lock do not exist. Note that the automatic conversion is still disabled in activate call, so the original fix (reactivation of exlusive LV) should be still in place.
* Allow implicit "convert" to the same lock mode.Milan Broz2009-12-091-0/+5
| | | | | | | (Code already not fail if unlocking not locked resource.) This is needed in pre/post lock_lv call, where we can request the same lock on local node becuase of suspend call.
* Get rid of magic masks in cluster locking code - clvmd part.Milan Broz2009-12-091-2/+2
| | | | | | | | | | | - do_command and lock_vg expect flags (no change here) Bug fixes: - lock_vg should check for NONBLOCK on lock_cmd, flags have this bit masked-out - do_pre/post_command expect do not mask flag at all, this causes that the code inside is never run! (see following patches, these functions expect plain command without flags)
* Revert vg_read_internal change, clvmd cannot use vg_read now. (2.02.55)Milan Broz2009-11-231-2/+3
|
* Un-export vg_read_internal.Petr Rockai2009-11-191-3/+2
|
* Fix clvmd segfault when refresh_toolcontext fails. (brassow, bz 506986)Alasdair Kergon2009-10-221-3/+6
|
* Stop clvmd from automatically doing lock conversions. Now, if a lockChristine Caulfield2009-10-011-9/+17
| | | | | | | | | | is granted at one mode and an attempt to convert it wthout the LCK_CONVERT flag set then it will return errno=EBUSY. This fixes a pretty bad bug in which an LV could be activated exclusively on one node and lvchange -ay on another would convert it to shared! It might break some things in other areas, but I doubt it.
* Fix locking in clvmdChristine Caulfield2009-08-051-6/+6
| | | | | | The changes to remove LCK_NONBLOCK from the LVM locks broke clvmd because the code was clearly wrong but working anyway! The constant was being masked rather than the variable that was supposed to match against it.
* All LV locks are non-blocking so remove LCK_NONBLOCK from separate macros.Alasdair Kergon2009-07-241-7/+5
|
* Add lvm_errno and lvm_errmsg to liblvm to obtain failure information.Alasdair Kergon2009-07-161-0/+5
| | | | | Change create_toolcontext to still return an object if it fails part-way. Add EUNCLASSIFIED (-1) as the default LVM errno code.
* Store any errno and error messages issued while processing each command.Alasdair Kergon2009-07-151-2/+2
| | | | | (Enabled by default while we test it, but in due course we'll only store the error messages when we need to.)
* Make cmd->cmd_line const.Alasdair Kergon2009-07-131-1/+1
|
* Destroy toolcontext on exit in clvmd (fixes memory pool leaks).Milan Broz2009-06-151-0/+7
|
* Re-instate partial activation support in clustered mode. (mornfall)Milan Broz2009-06-121-1/+6
|
* Add infrastructure for queriying for remote locks.Milan Broz2009-05-191-0/+20
| | | | | | | | | | | | | Current code, when need to ensure that volume is not active on remote node, it need to try to exclusive activate volume. Patch adds simple clvmd command which queries all nodes for lock for given resource. The lock type is returned in reply in text. (But code currently uses CR and EX modes only.)
* Tidy lv_hash[_lock] use inside clvmd.Milan Broz2009-04-211-33/+62
| | | | | | | | | | | - Rename unlock_all to destroy_lvhash, this function is called in cluster shutdown unlocks everything and clean up allocated info space. - Tidy lv_hash_lock use . Except adding free(lvi) in lv_has destructror there is no functional change.
* Properly release VG memory pool in activation code and clvmd.Milan Broz2009-04-101-0/+1
|
* Fix possible increasing in memory allocation if refreshing_contextMilan Broz2009-03-051-8/+16
| | | | | | | | | | | | | | | | | | | | (for example when CLVMD_CMD_LOCK_VG for is called during vgscan). If clvmd calls LV lock, it calls /* clean the pool for another command */ dm_pool_empty(cmd->mem); to clean up memory pool after command. Unfortunately, do_refresh_cache() do not call this and because during it operation it allocates some memory, the pool increases. Also do_refresh_cache should use lvm_lock (it manipulates with lvm internal data). The same applies for lvm_backup command. Signed-off-by: Milan Broz <mbroz@redhat.com>
* Add system_dir parameter to create_toolcontext() and call it system_dirAlasdair Kergon2009-02-221-2/+2
| | | | everywhere for consistency.
* Rename vg_read() to vg_read_internal(). (mornfall)Alasdair Kergon2009-01-261-1/+1
|
* Create global is_static() to eliminate from the library init function.Dave Wysochanski2008-12-181-1/+1
| | | | | | | | Very simple / crude method of removing 'is_static' from initialization. Why should we require an application tell us whether it is linked statically or dynamically to libLVM? If the application is linked statically, but libraries exist and dlopen() calls succeed, why do we care if it's statically linked?
* Remove struct arg * from struct cmd_context and create_toolcontext().Dave Wysochanski2008-12-171-1/+1
| | | | | | | | | | | This allows us to remove one argument from create_toolcontext() and moves it closer to a generic library init function. In the arg_*() functions, we just use _the_args() directly. For now we leave the first parameter to these arg_*() functions (struct cmd_context *) because of the number of files involved in removing the parameter.
* Remove redundant set_activation() call after create_toolcontext() calls.Dave Wysochanski2008-12-111-1/+0
| | | | | | | | | | Very similar argument to removal of init_debug() and other calls. create_toolcontext() calls _process_config() which sets cmd->default_settings.activation, then calls set_activation(cmd->default_settings.activation). Later, create_toolcontext() sets cmd->current_settings = cmd->default_settings. So these calls set_activation(cmd->current_settings.activation) are redundant.
* Remove backup_enable() calls after create_toolcontext() calls.Dave Wysochanski2008-12-111-1/+0
| | | | | | | Identical argument to previous patch which removed archive_enable() calls. We add a new parameter to backup_init() which sets the enable value based on the cmd->default_settings.backup value. This value was used to set cmd->current_settings.backup, used in the removed backup_enable() call.
* Remove archive_enable() calls after create_toolcontext() calls.Dave Wysochanski2008-12-111-1/+0
| | | | | | | | | | | | _init_backup() calls archive_init(), which originally set 'enabled' to a hardcoded '1' value. This seems incorrect based on my read of other areas of the code so here we add a 'enabled' paramter to archive_init(). We pass in cmd->default_settings.archive, which is obtained from the config tree. Later in create_toolcontext, cmd->current_settings is set to cmd->default_settings. The archive_enable() call we remove here was using cmd->current_settings to set the 'archive' enable value. The final value of cmd->archive_params->enabled should thus be equivalent to the original code.
* Remove init_verbose() calls immediately after create_toolcontext() calls.Dave Wysochanski2008-12-111-1/+0
| | | | | | | | | | | | | | | | The rationale for removing init_verbose() call is very similar to removing init_debug() call. create_toolcontext() calls _init_logging() which makes these calls: /* Verbose level for tty output */ cmd->default_settings.verbose = find_config_tree_int(cmd, "log/verbose", DEFAULT_VERBOSE); init_verbose(cmd->default_settings.verbose + VERBOSE_BASE_LEVEL); And being that create_toolcontext() copies default_settings into current_settings at the bottom, the init_verbose() call we are removing: init_verbose(cmd->current_settings.verbose + VERBOSE_BASE_LEVEL); is redundant.
* Remove init_debug() calls immediately after create_toolcontext() call.Dave Wysochanski2008-12-111-1/+0
| | | | | | | | | | | | | | | | | | | | We can safely remove because create_toolcontext() calls _init_logging(), which makes these calls: /* Debug level for log file output */ cmd->default_settings.debug = find_config_tree_int(cmd, "log/level", DEFAULT_LOGLEVEL); init_debug(cmd->default_settings.debug); Then at the bottom of create_toolcontext() we do this: cmd->current_settings = cmd->default_settings; So the call we are removing from init_lvm() functions (clvmd and lvmcmdline): init_debug(cmd->current_settings.debug); Just sets the value of debug based on 'cmd->current_settings.debug'. Since cmd->current_settings is equivalent to cmd->default_settings, and init_debug() was called with cmd->default_settings, the call we remove is redundant.
* clvmdAlasdair Kergon2008-11-041-1/+6
|
* more fixesAlasdair Kergon2008-11-041-1/+0
|
* fix last releaseAlasdair Kergon2008-09-191-2/+1
|
* Improve the way VGs with PVs missing are handled so manual interventionAlasdair Kergon2008-09-191-6/+0
| | | | is required in fewer circumstances. (mornfall)
* cleaner LCK_LV decodingAlasdair Kergon2008-06-061-9/+8
|
* Decode numbers in clvmd debugging output.Alasdair Kergon2008-06-051-6/+96
|
* more cleanupAlasdair Kergon2008-05-091-2/+2
|
* More P_ and V_ lock cleanup.Alasdair Kergon2008-05-091-1/+2
|
* Add missing mutex around clvmd lvmcache_drop_metadata library call.Alasdair Kergon2008-05-091-0/+10
|
* Add config file overrides to clvmd when it reads the LVs list so thatChristine Caulfield2008-04-081-2/+2
| | | | config items 'command_names' and 'prefix' don't prevent it working.
* If lvm.conf was touched, clvmd attempted to update the toolcontextChristine Caulfield2008-04-041-3/+3
| | | | | but only did half of the job. It now shares the do_refresh_cache() function that vgscan invokes.
* Tidy the clvmd backup code.Patrick Caulfield2007-12-051-6/+14
| | | | | | Move the backups inside the protection of the VG lock, Don't backup if we have a suspended LV Correct the vg_read() call
* When we unlock a VG tell the clvmds to see if a backup of the metadata needsPatrick Caulfield2007-12-041-2/+21
| | | | to be done.
* Make it compile with new lv_info_by_lvid() prototypePatrick Caulfield2007-11-141-3/+3
|
* Fix clvmd logging so you can get lvm-level debugging out of it.Patrick Caulfield2007-08-241-1/+13
|