summaryrefslogtreecommitdiffstats
path: root/lib/locking
Commit message (Collapse)AuthorAgeFilesLines
* locking: clarify read-only locking error message v2Peter Rajnoha2012-07-251-1/+1
|
* locking: clarify read-only locking error messagePeter Rajnoha2012-07-251-1/+2
|
* cleanup: replace memset with struct initilizationZdenek Kabelac2012-06-221-5/+6
| | | | | Simplifies the code, properly detects too long socket paths, drops unused parameter.
* Add some lock commentsZdenek Kabelac2012-04-241-5/+5
|
* Fix exclusive lvmchange -aey to fail if volume is active on different node.Milan Broz2012-03-271-1/+1
| | | | | | | | | Activation on remote node should be tried only if it is masked by tags locally (like when hosttags enabled, IOW activate_lv_excl_local() doesn't return error.) Introduced change caused that lvchange -aey succeeded even if volume was activated exclusively remotely.
* 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.
* Remove unused and wrongly set cluster VG flag from clvmd lock query command.Milan Broz2012-03-261-1/+1
|
* Few more close and dev_close traceZdenek Kabelac2012-03-011-1/+2
| | | | Adding (void) where we cannot really report an error.
* Ignore result of unlock explicitelyZdenek Kabelac2012-02-271-1/+1
|
* Check that whole locking_dir fits _lock_dir bufferZdenek Kabelac2012-02-081-3/+9
|
* Ensure strncpy() function always ends with '\0'Zdenek Kabelac2012-02-081-1/+2
| | | | | Since last character needs to be \0 for string, pass buffer size smaller by 1 byte.
* Attempt to improve clustered 'lvchange -aey' behaviour to try local node beforeAlasdair Kergon2012-01-213-23/+56
| | | | remote nodes and address some existing anomalies.
* Preserve exclusive activation of cluster mirror when converting.Jonathan Earl Brassow2012-01-202-2/+2
| | | | | | | | | This patch to the suspend code - like the similar change for resume - queries the lock mode of a cluster volume and records whether it is active exclusively. This is necessary for suspend due to the possibility of preloading targets. Failure to check to exclusivity causes the cluster target of an exclusively activated mirror to be used when converting - rather than the single machine target.
* Add dm_uuid_prefix/dm_set_uuid_prefix for non-lvm users to override hard-codedAlasdair Kergon2012-01-101-4/+7
| | | | | | | LVM- prefix. Try harder not to leave stray empty devices around (locally or remotely) when reverting changes after failures while there are inactive tables.
* Don't pass LCK_LOCAL to clvmd - it's unused.Alasdair Kergon2011-12-081-4/+6
| | | | Pass LCK_CLUSTER_VG in args[0] instead of args[1].
* Update comments. CLUSTER_VG belongs firmly to args[0].Alasdair Kergon2011-12-081-6/+7
|
* Fix FIXME and comment :-)Milan Broz2011-12-031-2/+2
|
* Switch locking bits to match RHEL5 version.Milan Broz2011-12-031-4/+8
| | | | | | FIXME: There is a problem with overloaded bit 0x80 in locking flag, the bit flags array must be extended or changed.
* Update comment on LCK_*DMEVENTD*.Petr Rockai2011-11-301-2/+3
|
* Fix clvmd to respect DMEVENTD_MONITOR_IGNORE. Fixes a bug where dmeventdPetr Rockai2011-11-302-1/+5
| | | | actions caused clvmd to turn off monitoring of the volume causing the action.
* Pass exclusive LV locks to all nodes in the cluster.Alasdair Kergon2011-10-211-1/+0
| | | | | | This was the intended behaviour, as described in the lvchange man page, so you have complete control through volume_list in lvm.conf, but the code seems to have been treating -ae as local-only for a very long time.
* Introduce revert_lv for better pvmove cleanup.Alasdair Kergon2011-09-275-4/+26
| | | | (One further fix needed to remove the stray pvmove LVs left behind.)
* Abort if _finish_pvmove suspend_lvs fails instead of cleaning up incompletely.Alasdair Kergon2011-09-272-3/+12
| | | | | Change suspend_lvs to call vg_revert internally. Change vg_revert to void and remove superfluous calls after failed vg_commit.
* Move the core of the lib/config/config.c functionality into libdevmapper,Petr Rockai2011-08-302-3/+3
| | | | | | | 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.
* Suppress locking error messages in monitoring init scripts.Peter Rajnoha2011-08-111-1/+1
|
* 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.
* If anything bad happens and unlocking failsMilan Broz2011-08-101-9/+13
| | | | | | | | | | | | | | (here clvmd crashed in the middle of operation), lock is not removed from cache - here is one example: locking/cluster_locking.c:497 Locking VG V_vg_test UN (VG) (0x6) locking/cluster_locking.c:113 Error writing data to clvmd: Broken pipe locking/locking.c:399 <backtrace> locking/locking.c:461 <backtrace> Internal error: Volume Group vg_test was not unlocked Code should always remove lock info from lvmcache and update counters on unlock, even if unlock fails.
* Suppress low-level locking errors and warnings while using --sysinit.Peter Rajnoha2011-08-096-33/+46
| | | | | | | | | | | | | | | | | Today, we use "suppress_messages" flag (set internally in init_locking fn based on 'ignorelockingfailure() && getenv("LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES")'. This way, we can suppress high level messages like "File-based locking initialisation failed" or "Internal cluster locking initialisation failed". However, each locking has its own sequence of initialization steps and these could log some errors as well. It's quite misleading for the user to see such errors and warnings if the "--sysinit" is used (and so the ignorelockingfailure && LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES environment variable). Errors and warnings from these intermediary steps should be suppressed as well if requested. This patch propagates the "suppress_messages" flag deeper into locking init functions. I've also added these flags for other locking types for consistency, though it's not actually used for no_locking and readonly_locking.
* Major pvmove fix to issue ioctls in the correct order when multiple LVsAlasdair Kergon2011-06-111-2/+2
| | | | | | | | | | | 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.
* Propagate test mode to clvmd to skip activation and changes to held locks.Alasdair Kergon2011-06-012-0/+4
|
* pre-release clean-upsAlasdair Kergon2011-04-291-2/+2
|
* clean up critical section patchAlasdair Kergon2011-04-282-8/+11
|
* Fix some unmatching sign comparation gcc warningsZdenek Kabelac2011-04-081-1/+1
| | | | Simple replacement for unsigned type - usually in for() loops.
* Fix some forgotten -Wold-style-definition gcc warningsZdenek Kabelac2011-04-081-1/+2
|
* Fix sending uninitilised bytes in cluster messagesZdenek Kabelac2011-03-291-2/+4
| | | | | | 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.
* Critical sectionZdenek Kabelac2011-02-182-4/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | New strategy for memory locking to decrease the number of call to to un/lock memory when processing critical lvm functions. Introducing functions for critical section. Inside the critical section - memory is always locked. When leaving the critical section, the memory stays locked until memlock_unlock() is called - this happens with sync_local_dev_names() and sync_dev_names() function call. memlock_reset() is needed to reset locking numbers after fork (polldaemon). The patch itself is mostly rename: memlock_inc -> critical_section_inc memlock_dec -> critical_section_dec memlock -> critical_section Daemons (clmvd, dmevent) are using memlock_daemon_inc&dec (mlockall()) thus they will never release or relock memory they've already locked memory. Macros sync_local_dev_names() and sync_dev_names() are functions. It's better for debugging - and also we do not need to add memlock.h to locking.h header (for memlock_unlock() prototyp).
* Fix for bug 677739: removing final exclusive cmirror snapshot,Jonathan Earl Brassow2011-02-182-2/+2
| | | | | | | | | | | | | results in clvmd deadlock When a logical volume is activated exclusively in a cluster, the local (non-cluster-aware) target is used. However, when creating a snapshot on the exclusive LV, the resulting suspend/resume fails to load the appropriate device-mapper table - instead loading the cluster-aware target. This patch adds an 'exclusive' parameter to the pertinent resume functions to allow for the right target type to be loaded.
* Allow snapshots in a cluster as long as they are exclusivelyJonathan Earl Brassow2011-02-042-2/+5
| | | | | | | | | | | | | | | activated. In order to achieve this, we need to be able to query whether the origin is active exclusively (a condition of being able to add an exclusive snapshot). Once we are able to query the exclusive activation of an LV, we can safely create/activate the snapshot. A change to 'hold_lock' was also made so that a request to aquire a WRITE lock did not replace an EX lock, which is already a form of write lock.
* Remove extra sync calls.Zdenek Kabelac2011-02-041-3/+1
| | | | | | | Remove temporaly added fs_unlock() calls to fix clmvd usablity. Now when the message passing is properly working - they are no longer needed. Simplify no_locking check for VG unlock - as message is always send for all targets - clustered & non-clustered.
* Use cluster-wide message to request device name syncZdenek Kabelac2011-02-043-5/+19
| | | | | | | | | Thanks to CLVMD_CMD_SYNC_NAMES propagation fix the message passing started to work. So starts to send a message before the VG is unlocked. Removing also implicit sync in VG unlock from clmvd as now the message is delievered and processed in do_command(). Also add support for this new message into external locking and mask this event from further processing.
* a few more commentsAlasdair Kergon2011-02-021-2/+6
|
* Allow CLVMD_CMD_SYNC_NAMES to be propagated around the cluster if requested.Alasdair Kergon2011-02-021-7/+11
|
* Better fix for no-locking udev sync and clvmdZdenek Kabelac2011-02-021-1/+3
| | | | | | | This is better way how to fix clustered synchronization with udev. As the code for message passing needs fixed - put currently fs_unlock() after every active/deactive command in clvmd to ensure nodes are properly created in time.
* Revert wrong fix for nolock locking missing fs_unlockZdenek Kabelac2011-02-022-4/+1
| | | | | Patch was wrond and introduced recursive lock_vol Reverting it.
* fix bad 'strcmp's in 'decode_lock_type' - missing !'sJonathan Earl Brassow2011-02-011-5/+5
| | | | | | | There was no effect from having this wrong yet, because the tree of callers only ever cared about the answer to the first condition (!response), which determines whether a lock is held or not. Correct responses, however, are needed soon.
* Fix udev synchronization for no-locking modeZdenek Kabelac2011-01-312-1/+4
| | | | | | | | | | | | | | Instead of implicitly syncing udev operation in clustered and file locking code - call synchronization directly in lock_vol() when the operation unlocks VG The problem is missing implicit fs_unlock() in the no_locking code. This is used with --sysinit on read-only filesystem locking dir. In this case vgchange -ay could exit before all udev nodes are properly synchronised and may cause problems with accessing such node right after vgchange --sysinint command is finished. Add test case for vgchange --sysinit.
* Skip NULL check before dm_freeZdenek Kabelac2011-01-281-2/+1
| | | | dm_free checks for NULL itself.
* Skip unnecessary lock_vol() call after volume deactivationZdenek Kabelac2011-01-131-12/+13
| | | | | | | | | Improve condition within lock_vol so we are not calling extra unlock if the volume just has been deactivated. Patch uses lck_type and replaces negative 'and' condition to more readable 'or' condition. Few missing strace traces added.
* Replace fs_unlock by sync_local_dev_names to notify local clvmd. (2.02.80)Alasdair Kergon2011-01-125-8/+22
| | | | Introduce sync_local_dev_names and CLVMD_CMD_SYNC_NAMES to issue fs_unlock.
* Speedup consequent activation callsZdenek Kabelac2011-01-101-0/+1
| | | | | | | | | | | | | | | | | | | | | Stop calling fs_unlock() from lv_de/activate(). Start using internal lvm fs cookie for dm_tree. Stop directly calling dm_udev_wait() and dm_tree_set/get_cookie() from activate code - it's now called through fs_unlock() function. Add lvm_do_fs_unlock() Call fs_unlock() when unlocking vg where implicit unlock solves the problem also for cluster - thus no extra command for clustering environment is required - only lvm_do_fs_unlock() function is added to call lvm's fs_unlock() while holding lvm_lock mutex in clvmd. Add fs_unlock() also to set_lv() so the command waits until devices are ready for regular open (i.e. wiping its begining). Move fs_unlock() prototype to activation.h to keep fs.h private in lib/activate dir and not expose other functions from this header.