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

693 Commits

Author SHA1 Message Date
Petr Rockai
182d1f60d2 Also use DEFAULT_RUN_DIR for the lvmetad socket on the client side. 2012-02-23 11:40:24 +00:00
Petr Rockai
daa0000a47 Tweak lvmetad a bit more:
- allow at most one PV on any given device
- allow PV lookup by device
- merge the pvmeta info into VG metadata when responding to vg_lookup
2012-02-21 09:19:08 +00:00
Petr Rockai
64a20df41c Drop the now-redundant pvid_to_status hash. 2012-02-15 17:37:09 +00:00
Petr Rockai
ff455b1806 Update lvmetad: use device major/minor pair to track devices. Keep a pvmeta
config tree per PV which is mostly provided by the client, so it can be used to
keep track of things like label_sector, PV format, mda count / offsets and so
on.
2012-02-15 17:30:07 +00:00
Petr Rockai
12dba91d9d (lvmetad) Remove unused variable. 2012-02-15 14:15:50 +00:00
Petr Rockai
23ce26fe22 In lvmetad, also nuke VGs when all their PVs are stolen by another VG (vgmerge
& vgsplit do this).
2012-02-15 14:06:48 +00:00
Zdenek Kabelac
80202ecd98 Detect failing fifo
If the fifo died because of dmeventd restart - do not wait for 20s
in select  - it will not get better and return error immediately.
2012-02-15 13:56:47 +00:00
Petr Rockai
69a82801ef lvmetad server-side update:
- rename the hashes to be explicit about the mapping
- add VG/PV listing calls to the protocol
- cache slightly more of the per-PV state
- filter cached metadata
- compare the metadata upon metadata_update
2012-02-15 11:43:06 +00:00
Petr Rockai
351aefc8a0 Do not forget to initialise the error value in daemon_reply. 2012-02-15 09:14:54 +00:00
Zdenek Kabelac
99e2a2e156 Add some FIXME around allocation code
Remove also unreachable break..
2012-02-13 14:25:14 +00:00
Zdenek Kabelac
5e4f234918 Make sure dereferenced words[0] and words[1] are defined 2012-02-13 14:17:04 +00:00
Zdenek Kabelac
74b5744b4b Check for missing reply_uuid 2012-02-13 11:24:09 +00:00
Zdenek Kabelac
65d01ed981 Check for allocation failure 2012-02-13 11:18:45 +00:00
Zdenek Kabelac
8380b37529 Fix message check
Check pointer from strchr for NULL instead of crash later.
Badly formated message would have crash dmeventd otherwise.
2012-02-10 15:17:52 +00:00
Zdenek Kabelac
5726f4aaac Remove unreachable code 2012-02-10 13:46:23 +00:00
Zdenek Kabelac
cdcf7aaf07 A bit more readable code
Just a minor readability conversion.
2012-02-08 13:03:40 +00:00
Zdenek Kabelac
a6292f2a6d Remove unneeded assignments
Variables have (or will have) those values set.
2012-02-08 11:36:18 +00:00
Zdenek Kabelac
3a8b6a9948 Keep page_size as signed number
Since it's return value from sysconf and is checked for <0.
2012-02-08 11:34:46 +00:00
Zdenek Kabelac
b63b775143 Add boundary test for number of mirror devs and logs
As atoi may return negative value - test for both limits.
Test log_args for limits before calling alloca().
Code from dmeventd mirror plugin should probably share same code as
we have in mirrored.c.
2012-02-08 11:29:13 +00:00
Petr Rockai
cd466297f4 Remove a dubious log message ("another thread is handling an event") from LVM
dmeventd plugins. Fixes RHBZ 771419.
2012-02-01 20:11:58 +00:00
Alasdair Kergon
b6d7a48480 Automatically detect whether corosync clvmd needs to use confdb or cmap. (fabio) 2012-01-31 21:21:53 +00:00
Zdenek Kabelac
eb2dd721ab Oops missed braces in previous commit
This has disabled clvmd for being executed.
(FIXME improve testing part to catch this fault)
2012-01-26 17:55:55 +00:00
Zdenek Kabelac
4125cf5067 Fix leak of hash table
Minor leak on command initialization.
2012-01-25 22:36:33 +00:00
Zdenek Kabelac
254944d890 Set to a defined value vars used after error path
Static analyzer noticed this vars are used even when error is reported
back thus their state is undefined - set to 0 for this case.
2012-01-25 22:20:11 +00:00
Zdenek Kabelac
b45035ee14 Test for uname result
in fail path initialize to 0.
2012-01-25 22:17:57 +00:00
Zdenek Kabelac
d85050930b Add breaks for cases 2012-01-25 21:42:09 +00:00
Zdenek Kabelac
5f3191097d Ensure reply struct has all fields defined
Reply is returned by value.
2012-01-25 21:31:59 +00:00
Zdenek Kabelac
6e2761e928 Check and print perror for syscalls 2012-01-25 21:30:27 +00:00
Zdenek Kabelac
a16915cb0b Clean var declarations to the front of the function 2012-01-25 13:06:57 +00:00
Alasdair Kergon
cab1c8ade1 Add CLVMD_FLAG_REMOTE to skip processing on local node. 2012-01-21 05:31:54 +00:00
Zdenek Kabelac
d4016dd4d0 Thin forgotten initialisation of pointer to NULL
Since the code may go in error path, set to defined NULL.
2012-01-20 10:59:26 +00:00
Jonathan Earl Brassow
25d1410592 Preserve exclusive activation of cluster mirror when converting.
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.
2012-01-20 00:27:18 +00:00
Zdenek Kabelac
80b21b0b50 Drop unused variable 2012-01-19 15:59:51 +00:00
Zdenek Kabelac
5fd459f0ab Thin use consistentely metadata
Do not shortcut to 'meta' and stay with 'metadata'
Also matches kernel doc for dm API then.
2012-01-19 15:21:23 +00:00
Petr Rockai
cf1b05e7dd Beef up the lvmetad code with more functionality and a bunch of bugfixes. There
used to be a few mis-ordered memory accesses (release and access in the next
block). Fix that set_flag could have sometimes corrupted the flags being
modified.

A few issues with metadata tracking are sorted out as well now, and there are
only a few problems remaining before we can integrate lvmetad, mostly on the
client side:

- metadata areas need to be tracked in lvmetad (most likely to be addressed
  through an extension of metadata, meaning no special support in lvmetad would
  be needed)
- non-udev scanning code needs to be taught about telling lvmetad about device
  disappearance (pvscan most importantly)
- this last item also needs to mesh with metadata inconsistencies and
  suddenly-incomplete volume groups (aux disable_dev in tests); udev-based
  scanning should address this separately and more elegantly
2012-01-16 08:25:32 +00:00
Petr Rockai
3556560b38 Fix a boundary condition in read_buffer in daemon-shared.c. 2012-01-16 05:09:16 +00:00
Petr Rockai
d528658f97 Fix prototypes for daemon_send_simple (const char). 2012-01-15 15:16:50 +00:00
Petr Rockai
f43c89bf71 Unfortunately, blank lines are sometimes produced by config serializer, and
this interferes with their role as message separator in the lvmetad
protocol. Switch to using "##" on an otherwise blank line as a separator.
2012-01-15 11:17:16 +00:00
Petr Rockai
d540685159 Fix a couple of resource leaks in daemon-common server code -- filehandles and
unjoined threads were leaked for each connection.
2012-01-15 10:33:41 +00:00
Zdenek Kabelac
1aae627433 Use new dmeventd_lvm2_command function in dmeventd plugins.
For snapshot, prepare whole command in front into private buffer.
Add also some missing '\n' for syslog messages.
For raid and mirror only convert creation of command line string.
This should avoid any unbound growth of mempool for dm_split_names.
2011-12-22 16:37:01 +00:00
Zdenek Kabelac
ed1289140e Thin use helper function
Fix some minor outstading issue from thin plugin introduction -
Call dmeventd_lvm2_exit() in failpath for registration.
Add some missing '\n' in syslog messages.
2011-12-22 15:57:29 +00:00
Zdenek Kabelac
8527b92738 Add helper function dmeventd_lvm2_command().
Since this code is in all plugins - create a common helper function.
2011-12-22 15:55:21 +00:00
Zdenek Kabelac
59e1bb62de Updated documentation for dmeventd.
Update man page style.
Mention raid and thin plugins.
Update help text printed by command to match man page.
2011-12-22 15:50:38 +00:00
Zdenek Kabelac
351bf47486 Exported functions from thin plugin 2011-12-21 13:42:07 +00:00
Zdenek Kabelac
2bc1d7598e Thin add dmeventd support
This is basic version with still few unresolved issue mainly in case,
when the pool resize is failing.
2011-12-21 13:08:11 +00:00
Zdenek Kabelac
169470b621 Fix missing thread list manipulation
For manipulation with thread list to avoid race with timeout thread,
take also _timeout_mutex.
2011-12-21 13:03:06 +00:00
Petr Rockai
f401655ee8 Fix up lvmetad for the minor API change in dm_config_create. 2011-12-18 22:31:10 +00:00
Alasdair Kergon
594753751a Only use built-in stack size in clvmd - ignore lvm.conf. 2011-12-08 21:24:08 +00:00
Alasdair Kergon
585aaa922f Test for LCK_CLUSTER_VG directly in args[0].
Drop unused LCK_LOCAL from debug msg.
2011-12-08 18:32:33 +00:00
Jonathan Earl Brassow
d098140177 Add policy based automated repair of RAID logical volumes
The RAID plug-in for dmeventd now calls 'lvconvert --repair' to address failures
of devices in a RAID logical volume.  The action taken can be either to "warn"
or "allocate" a new device from any spares that may be available in the
volume group.  The action is designated by setting 'raid_fault_policy' in
lvm.conf - the default being "warn".
2011-12-06 19:30:15 +00:00