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

376 Commits

Author SHA1 Message Date
Milan Broz
676b511245 Fix syslog prefix in the first message (dmeventd->lvm). 2010-01-22 12:48:58 +00:00
Milan Broz
257bb03948 Fix exported symbols for lvm2 dmeventd wrapper. 2010-01-22 12:38:16 +00:00
Alasdair Kergon
86dce60ffe missing header 2010-01-22 00:43:28 +00:00
Alasdair Kergon
fff0de4865 fix lib include 2010-01-22 00:18:37 +00:00
Alasdair Kergon
d3d98fdc1e Add libdevmapper-event-lvm2.so to serialise dmeventd plugin liblvm2cmd use. 2010-01-21 22:15:45 +00:00
Alasdair Kergon
e408cf6906 Deal with a few more compiler warnings. 2010-01-20 02:43:19 +00:00
Alasdair Kergon
9bad95bd95 Remove mknod() and add FIXMEs.
In the udev-world, this function should work differently.
2010-01-19 18:21:03 +00:00
Alasdair Kergon
acdd91b3ce remove more compiler warnings
add FIXMEs for incomplete write()s
2010-01-19 17:24:29 +00:00
Alasdair Kergon
fc0c0cb075 Signal handling FIXMEs.
A few integer type changes.
2010-01-19 15:58:45 +00:00
Milan Broz
7a96516819 Never scan suspended devices in clvmd.
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).
2010-01-19 13:25:00 +00:00
Alasdair Kergon
f7729ec651 more build fixes 2010-01-19 01:10:46 +00:00
Alasdair Kergon
667c6be176 Clean up include files. 2010-01-18 21:07:24 +00:00
Jonathan Earl Brassow
98998134de Fix some compiler warnings. 2010-01-18 20:58:50 +00:00
Alasdair Kergon
3c4310d6ef Misc compilation clean-ups. 2010-01-18 20:08:44 +00:00
Jonathan Earl Brassow
27318b98a1 Make the intermachine communication structures architecture independant
to allow for mixed architecture clusters.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
2010-01-15 19:49:35 +00:00
Jonathan Earl Brassow
3579eeb2b0 When moving the cluster log server into the LVM tree, the in memory
bitmap tracking was switched from the e2fsprogs implementation to
the device-mapper implementation (dm_bitset_t).  The latter has a
leading uin32_t field designed to hold the number of bits that are
being tracked.  The code was not properly handling this change in
all places.  Specifically, when getting the bitmap to/from disk.

Endian adjustments will likely need to be made on the accounting
field as well, since bitmaps are passed between machines on
start-up.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
2010-01-15 18:48:24 +00:00
Jonathan Earl Brassow
e30f6c899d At some point "clustered_[core|disk]" was changed to "clustered-[core|disk]".
This patch makes the log server recognise the new format.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
2010-01-15 16:03:19 +00:00
Zdenek Kabelac
5a4eeb69c4 Cleanup gcc warning: null argument where non-null required (arg.2)
As the const declaration of execvp is a bit weird, using local
dmeventdpath string.
2010-01-14 10:11:26 +00:00
Milan Broz
bf8c8a6d61 Remove empty "repaired" devices if empty in lvconvert.
The logic was that lvconvert repair volumes, marking
PV as MISSING and following vgreduce --removemissing
removes these missing devices.

Previously dmeventd mirror DSO removed all LV and PV
from VG by simply relying on
vgreduce --removemissing --force.

Now, there are two subsequent calls:
lvconvert --repair --use-policies
vgreduce --removemissing

So the VG is locked twice, opening space for all races
between other running lvm processes. If the PV reappears
with old metadata on it (so the winner performs autorepair,
if locking VG for update) the situation is even worse.


Patch simply adds removemissing PV functionality into
lvconcert BUT ONLY if running with --repair and --use-policies
and removing only these empty missing PVs which are
involved in repair.
(This combination is expected to run only from dmeventd.)
2010-01-06 13:26:21 +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
ac85c2e75b Move processing of VG locks to separate function (similar to LV locks).
And print some debugging info.

No functional change in this patch.
2010-01-05 16:05:12 +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
Milan Broz
452bbb87a9 Fix missing include. 2009-12-09 19:30:56 +00:00
Milan Broz
27132718d4 Add memlock information to do_lock_lv debug output.
This helps a lot to detect that something strange happened.
2009-12-09 19:01:27 +00:00
Milan Broz
85fabd8116 Never ever use distributed lock for LV in non-clustered VG.
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.)
2009-12-09 19:00:16 +00:00
Milan Broz
4b3efd3537 Allow implicit lock conversion for pre/post callbacks.
This is unnoticed regression from commit 31672ff60e

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.
2009-12-09 18:55:53 +00:00
Milan Broz
4499aa2ea5 Allow implicit "convert" to the same lock mode.
(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.
2009-12-09 18:45:12 +00:00
Milan Broz
cc31b2bd3f Get rid of magic masks in cluster locking code - clvmd part.
- 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)
2009-12-09 18:42:02 +00:00
Alasdair Kergon
32780caae3 Log failure type and recognise type 'F' (flush) in dmeventd mirror plugin. 2009-11-25 15:59:07 +00:00
Milan Broz
a4893bc377 Revert vg_read_internal change, clvmd cannot use vg_read now. (2.02.55) 2009-11-23 10:44:50 +00:00
Petr Rockai
090585a8f4 Un-export vg_read_internal. 2009-11-19 12:13:37 +00:00
Milan Broz
f145ddc9e7 Fix install_device-mapper Makefile target to not build dmeventd plugins. 2009-11-13 12:48:01 +00:00
Alasdair Kergon
cb63efc6f9 Fix clvmd segfault when refresh_toolcontext fails. (brassow, bz 506986) 2009-10-22 17:45:23 +00:00
Petr Rockai
241e84f79d Only announce mirror monitoring to syslog after initialisation succeeds. 2009-10-22 10:40:41 +00:00
Alasdair Kergon
ae1e83aa94 Attempt to build dmeventd.static. 2009-10-13 02:35:26 +00:00
Alasdair Kergon
902c4069dc More build cleanups (linker parameter ordering). 2009-10-13 01:31:10 +00:00
Christine Caulfield
c503c83c78 Make clvmd return 0 on success rather than 1. 2009-10-12 08:33:30 +00:00
Alasdair Kergon
79aa89a62a Extra libs must be appended, not defined first. 2009-10-09 16:04:54 +00:00
Alasdair Kergon
437219e27d More makefile cleaning up and fixing. (gentoo) 2009-10-05 13:46:00 +00:00
Alasdair Kergon
db8b5af9d9 Allow for a build directory separate from the source. 2009-10-02 19:10:31 +00:00
Christine Caulfield
29846c24a8 Stop clvmd from automatically doing lock conversions. Now, if a lock
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.
2009-10-01 14:14:17 +00:00
Alasdair Kergon
cf8ee443e5 Fix dmeventd _temporary_log_fn parameters. (2.02.50) 2009-09-17 10:37:23 +00:00
Alasdair Kergon
d0800aba01 missing (C) reminders 2009-09-15 12:51:28 +00:00
Alasdair Kergon
90c8088760 More cmirror makefile fixes from Fabio. 2009-09-14 22:57:46 +00:00
Dave Wysochanski
2433909e20 Add daemons/cmirrord files to git - somehow got messed up with cvs rename.
When clogd was renamed to cmirrord, somehow git got the remove of the old
files but not the add of the new files.  This patch adds the new files.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
2009-09-04 20:44:58 +02:00
Alasdair Kergon
2bda19e999 rename clogd dir to cmirrord 2009-09-02 17:36:46 +00:00
Fabio M. Di Nitto
c99b9fa946 Fix cmirrod build directory while we wait to do a proper rename of the
directory and move files.
2009-09-02 11:49:03 +00:00
Fabio M. Di Nitto
f8d076d827 Drop clogd Makefile from CVS since it's always autogenerated from Makefile.in
at configure time.
2009-09-01 19:13:38 +00:00