summaryrefslogtreecommitdiffstats
path: root/lib/locking/file_locking.c
Commit message (Collapse)AuthorAgeFilesLines
* Few more close and dev_close traceZdenek Kabelac2012-03-011-1/+2
| | | | Adding (void) where we cannot really report an error.
* Check that whole locking_dir fits _lock_dir bufferZdenek Kabelac2012-02-081-3/+9
|
* Preserve exclusive activation of cluster mirror when converting.Jonathan Earl Brassow2012-01-201-1/+1
| | | | | | | | | 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.
* Introduce revert_lv for better pvmove cleanup.Alasdair Kergon2011-09-271-2/+3
| | | | (One further fix needed to remove the stray pvmove LVs left behind.)
* Suppress low-level locking errors and warnings while using --sysinit.Peter Rajnoha2011-08-091-3/+6
| | | | | | | | | | | | | | | | | 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.
* Fix some forgotten -Wold-style-definition gcc warningsZdenek Kabelac2011-04-081-1/+2
|
* Fix for bug 677739: removing final exclusive cmirror snapshot,Jonathan Earl Brassow2011-02-181-1/+1
| | | | | | | | | | | | | 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.
* Use cluster-wide message to request device name syncZdenek Kabelac2011-02-041-1/+0
| | | | | | | | | 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.
* Revert wrong fix for nolock locking missing fs_unlockZdenek Kabelac2011-02-021-0/+1
| | | | | Patch was wrond and introduced recursive lock_vol Reverting it.
* Fix udev synchronization for no-locking modeZdenek Kabelac2011-01-311-1/+0
| | | | | | | | | | | | | | 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.
* Replace fs_unlock by sync_local_dev_names to notify local clvmd. (2.02.80)Alasdair Kergon2011-01-121-0/+3
| | | | 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.
* Check result of dm_snprintf for errorZdenek Kabelac2011-01-051-6/+14
|
* Add new dm_prepare_selinux_context fn to libdevmapper and use it throughout.Peter Rajnoha2010-12-131-1/+8
| | | | | | | | | | | Detect existence of new SELinux selabel interface during configure. Use new dm_prepare_selinux_context instead of dm_set_selinux_context. We should set the SELinux context before the actual file system object creation. The new dm_prepare_selinux_context function sets this using the selabel_lookup fn in conjuction with the setfscreatecon fn. If selinux/label.h interface (that should be a part of the selinux library) is not found during configure, we fallback to the original matchpathcon function instead.
* Use 'SINGLENODE' instead of 'dead' in clvmd singlenode messages.Alasdair Kergon2010-08-171-6/+5
| | | | | | Ignore snapshots when performing mirror recovery beneath an origin. Pass LCK_ORIGIN_ONLY flag around cluster. Add suspend_lv_origin and resume_lv_origin using LCK_ORIGIN_ONLY.
* Allow internal suspend and resume of origin without its snapshots.Alasdair Kergon2010-08-171-2/+4
|
* Use void parameter for function definition.Zdenek Kabelac2010-08-031-1/+1
|
* Use __attribute__ consistently throughout.Alasdair Kergon2010-07-091-1/+1
|
* Add is_global_vg and split out from is_orphan_vg.Alasdair Kergon2010-05-191-1/+1
|
* Use is_orphan_vg in place of hard-coded prefix tests.Alasdair Kergon2010-05-191-1/+1
|
* 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.
* Implement write lock prioritisation for file locking and make it default.Petr Rockai2009-09-021-1/+36
|
* Refactor file locking, lifting the flock wrapper code into separatePetr Rockai2009-08-131-54/+70
| | | | | functions. Also fixes a bug, where a nonblocking lock could, in certain race situations, succeed without actually obtaining the lock.
* * minor compilator warning fix for improper function declaration.Zdenek Kabelac2008-11-121-1/+1
|
* Right, a simple build (without options) is working again.Alasdair Kergon2008-11-031-8/+8
|
* more cleanupAlasdair Kergon2008-05-091-2/+6
|
* More P_ and V_ lock cleanup.Alasdair Kergon2008-05-091-4/+1
|
* Drop cached VG metadata before and after committing changes to it.Milan Broz2008-04-151-0/+5
|
* Update lvmcache VG lock state for all locking types now.Milan Broz2008-04-071-11/+0
|
* Add some basic internal VG lock validation.Alasdair Kergon2008-04-031-1/+1
|
* Some whitespace tidy-ups.Alasdair Kergon2008-01-301-1/+1
|
* Decode cluster locking state in log message. (untested)Alasdair Kergon2007-11-161-7/+8
| | | | Change file locking state messages from debug to very verbose.
* Introduce VG_GLOBAL lock type for vgscan/pvscan to trigger clvmd -R.Alasdair Kergon2007-08-231-1/+4
|
* Clean up numerous compiler warnings that crept in recently.Alasdair Kergon2007-08-221-2/+2
| | | | Remove several unused parameters from _allocate().
* Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1.Alasdair Kergon2007-08-201-3/+3
|
* Remove create_dir function; use now-equivalent dm_create_dir instead.Jim Meyering2007-07-281-1/+1
| | | | | | | | | | * lib/misc/lvm-file.c (_create_dir_recursive, create_dir): Remove functions. * lib/misc/lvm-file.h (create_dir): Remove declaration. * lib/commands/toolcontext.c (create_toolcontext): s/create_dir/dm_create_dir/ * lib/format_text/archiver.c (archive, backup): Likewise. * lib/format_text/format-text.c (_add_dir): Likewise. * lib/locking/file_locking.c (init_file_locking): Likewise. Patch by Jun'ichi Nomura.
* Introduce is_same_inode macro, now including a comparison of st_dev.Jim Meyering2007-07-201-2/+2
| | | | | | | * lib/misc/lvm-file.h (is_same_inode): Define. * lib/filters/filter-persistent.c (persistent_filter_dump): Use is_same_inode in place of a direct st_ino-only comparison. * lib/locking/file_locking.c (_release_lock, _lock_file): Likewise.
* Don't leak a file descriptor in _lock_file when flock fails.Jim Meyering2007-07-201-0/+1
| | | | * lib/locking/file_locking.c (_lock_file): Close fd upon flock failure.
* Add some missing close() and fclose() return code checks.Alasdair Kergon2007-01-251-2/+2
| | | | Fix exit statuses of reporting tools (2.02.19).
* Move lvm_snprintf into libdevmapper.Alasdair Kergon2006-08-211-2/+2
|
* Fix lvcreate corelog validation.Alasdair Kergon2006-05-161-3/+3
| | | | | | | | | Add --config for overriding most config file settings from cmdline. Quote arguments when printing command line. Remove linefeed from 'initialising logging' message. Add 'Completed' debug message. Don't attempt library exit after reloading config files. Always compile with libdevmapper, even if device-mapper is disabled.
* Add mirror_library description to example.conf.Alasdair Kergon2006-05-111-1/+1
| | | | More compile-time cleanup.
* more coverity fixesAlasdair Kergon2006-05-101-1/+3
|
* Use hash, bitset, malloc, pool from libdevmapper.Alasdair Kergon2005-10-161-7/+7
|
* Prepare tools to support clustered mirrors.Alasdair Kergon2005-08-141-2/+2
|
* Tighten signal handlers.Alasdair Kergon2005-03-211-8/+12
|
* Revise internal locking semantics.Alasdair Kergon2004-05-051-2/+7
|
* Update copyright notices.Alasdair Kergon2004-03-301-2/+10
|
* Add locking flags + memlock option.Alasdair Kergon2004-03-261-0/+1
|
* rename config file vars & always use / as separatorAlasdair Kergon2004-03-081-3/+3
|