1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 03:27:58 +03:00
Commit Graph

147 Commits

Author SHA1 Message Date
Zdenek Kabelac
814aebc4e9 Use $(top_builddir) for inclusion of make.tmpl in Makefiles. 2010-03-04 09:51:37 +00:00
Peter Rajnoha
b9259173d0 Add LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES environment variable to suppress error
and warning mesages while --ignorelockingfailure is used.
2010-02-15 16:46:56 +00:00
Milan Broz
98d85f25be Move error message to locking constructor and print
more descriptive message if locking fails instead of
"Locking type -1 initialisation failed."

Use read-only locking instead of misleading ignorelocking option
in message.
2010-01-22 09:45:29 +00:00
Milan Broz
43b24f7c61 Fix clvmd automatic target module loading crash. 2010-01-13 17:40:17 +00:00
Mike Snitzer
56b3d20462 Add missing 'stack;' for all activate_lv and deactivate_lv callers.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2010-01-05 21:08:34 +00:00
Mike Snitzer
df13cf08d5 Add missing 'stack;' for all suspend_lv and resume_lv callers.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2010-01-05 21:07:31 +00:00
Milan Broz
0e06c92fdf Propagate commit and revert metadata event to other nodes in cluster.
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.
2010-01-05 16:09:33 +00:00
Milan Broz
c9118a1d20 Proper mask lock mode for vg lock.
Lock mode is int masked by LCK_TYPE_MASK, always.

Patch also remove uneccessary masking lock flag on sender side,
if masking is needed, it is don on client side already.
2010-01-05 16:07:56 +00:00
Milan Broz
d37be0b865 Add possibility to handle precommitted metadata in lvmcache.
- 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.
2010-01-05 16:06:42 +00:00
Milan Broz
d7f44761ab Properly decode flags even for VG locks.
And decode flags in humar readable form in client.
And clean some trailing whitespaces.

No functional change in this patch (only debugging messages changed).
2010-01-05 16:03:37 +00:00
Petr Rockai
550cae2340 #define an INTERNAL_ERROR macro and use it throughout LVM. 2009-12-16 19:22:11 +00:00
Zdenek Kabelac
b1ebf028de Cleanup returns for void functions. 2009-12-11 13:16:37 +00:00
Milan Broz
7251c8f3a5 Get rid of magic masks in cluster locking code.
Patch should not cause any problems, only real change is
removing LCK_LOCAL bit from lock type flag, it is never used there.
(LCK_LOCAL is part arg[1] bits anyway.)
2009-12-09 18:28:27 +00:00
Milan Broz
f9f8cd08b3 Get rid of hardcoded 0xffdf cluster lock flag.
There is hidded change - the upper flags (0xffff0000)
and now not cleared, but there are unused anyway.
2009-12-09 18:16:38 +00:00
Milan Broz
6b8304ab43 Fix memory lock imbalance in locking code.
(This affects only cluster locking because only cluster
locking module set LCK_PRE_MEMLOCK.)

With currect code you get
# vgchange -a n
  Internal error: _memlock_count has dropped below 0.
when using cluster locking.

It is caused by _unlock_memory calls here

  if ((flags & (LCK_SCOPE_MASK | LCK_TYPE_MASK)) == LCK_LV_RESUME)
     memlock_dec();

Unfortunately it is also (wrongly) called in immediate unlock
(when LCK_HOLD is not set) from lock_vol
(LCK_UNLOCK is misinterpreted as LCK_LV_RESUME).

Avoid this by comparing original flags and provide memlock
code type of operation (suspend/resume).
2009-11-23 10:55:14 +00:00
Alasdair Kergon
db8b5af9d9 Allow for a build directory separate from the source. 2009-10-02 19:10:31 +00:00
Christine Caulfield
5f3dc21dba Add LCK_CONVERT flag I missed on the last checkin. 2009-10-01 14:15:34 +00:00
Alasdair Kergon
651ff9b328 Add lots of missing stack debug messages to tools.
Make readonly locking available as locking type 4.
Fix readonly locking to permit writeable global locks (for vgscan). (2.02.49)
2009-09-14 22:47:49 +00:00
Dave Wysochanski
3de6df8410 Enforce an alphabetical lock ordering for vgname locks.
Add a new constraint that vgname locks must be obtained in
alphabetical order.  At this point, we have test coverage for
the 3 commands affected - vgsplit, vgmerge, and vgrename.
Tests have been updated to cover these commands.
Going forward any command or library call that must obtain
more than one vgname lock must do so in alphabetical order.
Future patches will update lvm2app to enforce this ordering.


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-09-02 21:34:11 +00:00
Petr Rockai
74aa6b5620 Implement write lock prioritisation for file locking and make it default. 2009-09-02 14:47:39 +00:00
Petr Rockai
5d5e2bf8f6 Refactor file locking, lifting the flock wrapper code into separate
functions. Also fixes a bug, where a nonblocking lock could, in certain race
situations, succeed without actually obtaining the lock.
2009-08-13 13:23:51 +00:00
Petr Rockai
0e867038da Allow LV suspend while --ignorelockingfailure is in force. 2009-08-02 21:03:09 +00:00
Alasdair Kergon
1cc59fa4ac Add global/wait_for_locks to lvm.conf so blocking on locks can be disabled. 2009-07-24 23:28:55 +00:00
Alasdair Kergon
2918b433a3 remove no-longer-needed NONBLOCK 2009-07-24 18:26:42 +00:00
Alasdair Kergon
c07d773e67 All LV locks are non-blocking so remove LCK_NONBLOCK from separate macros. 2009-07-24 18:15:06 +00:00
Petr Rockai
746bb69067 Fix warning. 2009-07-15 06:11:25 +00:00
Petr Rockai
ee2e742ae3 Fix bad prototype from previous checkin. 2009-07-15 05:57:11 +00:00
Petr Rockai
6ee7d2aa53 Remove lockingfailed().
We provide a lock type that behaves like no_locking, but is not
  clustered. Moreover, it also forbids any write locks. This magically (and
  consistently) prevents use of clustered VGs, or changing local VGs with
  --ignorelockingfailure. As a bonus, we can remove the special hacks in a few
  places. Of course, people looking for trouble can always set their locking_type
  to 0 to override.
2009-07-15 05:49:47 +00:00
Alasdair Kergon
7beb03dd2a Exclude VG_GLOBAL from vg_write_lock_held so scans open devs read-only again. (mbroz) 2009-07-14 11:01:26 +00:00
Milan Broz
5cc66af8d6 Re-instate partial activation support in clustered mode. (mornfall) 2009-06-12 08:30:19 +00:00
Alasdair Kergon
25a2e7b80e Pre-release cleanups. 2009-05-21 03:04:52 +00:00
Milan Broz
6ac30c94f2 Fix locking query compatibility with old external locking libraries. 2009-05-20 12:58:03 +00:00
Milan Broz
fa6dca9f28 Add infrastructure for queriying for remote locks.
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.)
2009-05-19 10:38:58 +00:00
Dave Wysochanski
5a820745ce 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.

Should be no functional change.
2009-05-13 13:02:52 +00:00
Milan Broz
dfbc015c69 Fix remote metadata backup for clvmd
Run backup of metadata on remote nodes in the
same place like local node - when calling backup().

Introduce backup_locally() which calls only
local backup if needed.

Remote backup is now trigerred by LCK_VG_BACKUP flag
combination (special VG lock).

This lock type will call check_current_backup()
(including backup_locally() call) and updates
metadata on all nodes.

(Patch fixes non-functional remote backup,
current call during VG lock never triggers.)
2009-04-22 09:39:45 +00:00
Milan Broz
8e1d5615b4 Introduce memory pool per volume group.
Since now, all code reading volume group is responsible for releasing
the memory allocated by calling vg_release(vg).
(For simplicity of use, vg_releae can be called for vg == NULL,
the same logic like free(NULL)).

Also providing simple macro for unlocking & releasing in one step,
tools usualy uses this approach.

The global memory pool (cmd->mem) should be used only for global
physical volume operations.

This patch have to be applied with all subsequent patches to complete
memory pool per vg logic.

Using separate memory pool has quite bit memory saving impact when
using large VGs, this is mainly needed when we have to use
preallocated and locked memory (and should not overflow from that
memory space).
2009-04-10 09:59:18 +00:00
Alasdair Kergon
47c0f6ae76 Fix interrupt unblocking after vgcreate, for example: drop_cached_metadata()
previously left _vg_lock_count incremented.
Other locks are always held during drop_cached_metadata() so there's no
need to increment+decrement it.
2009-02-22 16:13:57 +00:00
Dave Wysochanski
76cc7b2754 Move locking_type reading inside init_locking().
No functional change.
2009-02-03 16:23:19 +00:00
Dave Wysochanski
0296197999 Create global is_static() to eliminate from the library init function.
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?
2008-12-18 05:27:17 +00:00
Dave Wysochanski
0fb1762159 Rename 'cmd' to 'clvmd_cmd' to remove ambiguity.
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Acked-by: James Cameron <james.cameron@hp.com>
Acked-by: Alasdair G Kergon <agk@redhat.com>
2008-12-16 12:30:39 +00:00
Zdenek Kabelac
23cf7bc97c * minor compilator warning fix for improper function declaration. 2008-11-12 09:30:52 +00:00
Alasdair Kergon
56d8844068 more fixes 2008-11-04 15:07:45 +00:00
Alasdair Kergon
2c44337bd5 Right, a simple build (without options) is working again. 2008-11-03 22:14:30 +00:00
Alasdair Kergon
14c9a9aec7 Accept locking fallback_to_* options in the global section as documented. 2008-10-24 01:16:16 +00:00
Alasdair Kergon
8c5bcdabab Improve the way VGs with PVs missing are handled so manual intervention
is required in fewer circumstances.  (mornfall)
2008-09-19 06:42:00 +00:00
Milan Broz
74f36b9308 Do not scan for lvm1 entries in /proc if not running 2.4 kernel.
(LVM1 is only present in 2.4 kernel.)
2008-09-10 10:14:59 +00:00
Alasdair Kergon
3dfd8f12dc more cleanup 2008-05-09 19:26:58 +00:00
Alasdair Kergon
98fd1ce332 More P_ and V_ lock cleanup. 2008-05-09 18:45:15 +00:00
Alasdair Kergon
1a20d53171 Avoid unnecessary unlock attempts with LCK_CACHE pseudo-locks. 2008-05-08 18:35:58 +00:00
Milan Broz
581b17def2 Drop cached VG metadata before and after committing changes to it. 2008-04-15 14:46:19 +00:00