1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

730 Commits

Author SHA1 Message Date
Jonathan Earl Brassow
2ce9693341 s/CPG_/CS_: Various CPG constants are going away, even though CPG itself stays
F17 is getting rid of OpenAIS libraries (and checkpointing).  While the
CPG stuff is staying, some if its constants are being removed.  So, we
must adjust and use the remaining constants which the CPG constants were based on.

[~]# egrep 'CPG_DISPATCH_ALL|CPG_OK' /usr/include/*/*
corosync/corotypes.h:#define CPG_DISPATCH_ALL     CS_DISPATCH_ALL
corosync/corotypes.h:#define CPG_OK               CS_OK
2012-03-01 17:41:39 +00:00
Zdenek Kabelac
310f54439c More useful debug message 2012-03-01 10:41:48 +00:00
Zdenek Kabelac
f9467799c1 Check for allocation error
return ENOMEM when malloc fails.
2012-03-01 09:54:23 +00:00
Zdenek Kabelac
ce1c28af19 Log fail of pthread_join
Syslog error outside of mutex section.
2012-03-01 09:50:04 +00:00
Jonathan Earl Brassow
62e38da133 Allow cluster mirrors to handle the absence of the checkpoint lib (libSaCkpt).
The OpenAIS checkpoint library is going away; therefore, cmirrord must
operate without it.  The algorithms the handle the timing of when to send
a checkpoint, the determination of what to send, and which ongoing cluster
requests are relevent with respect to the checkpoints are unaffected.  We
need only replace the functions that actually perform the storing/transmitting
and retrieving/receiving of the checkpoint data.  Rather than store the
checkpoint data in an OpenAIS checkpoint file, we simply transmit it along
with the message that notifies the incoming node that the checkpoint is
ready.
2012-02-29 21:15:34 +00:00
Alasdair Kergon
7126d8c21b Reflect new file locations, include file updates etc. 2012-02-28 18:35:04 +00:00
Alasdair Kergon
e980d54371 remove old makefile 2012-02-28 18:31:28 +00:00
Alasdair Kergon
ec6559c93e move daemon files 2012-02-28 18:30:39 +00:00
Zdenek Kabelac
c682e83760 Check for failing dm_asprintf 2012-02-28 14:25:37 +00:00
Peter Rajnoha
870353f9d1 Add support for systemd socket handover for common daemon-server code and also add support for new OOM killer adjustment interface.
This code is already a part of dmeventd, but it's modified slightly to check
sockets instead of FIFOs.
2012-02-28 13:05:21 +00:00
Zdenek Kabelac
bd046f0201 Ensure clvmd message is always \0 terminated
Drop whole buffer clearing (most messages at <100 bytes).
Just make sure we have always \0 terminated string for strlen() operations.
(before for PIPE_BUF sized messages this was not set).
2012-02-28 11:06:56 +00:00
Zdenek Kabelac
c19d86338d Better detection of missing dmeventd fifo connection 2012-02-28 11:03:24 +00:00
Zdenek Kabelac
e5d399f667 Missed to properly merge patch for definition of MAX_MISSING_LEN
(fix previous commit)
2012-02-28 10:42:20 +00:00
Zdenek Kabelac
4d44893d60 Add log_sys_error for close 2012-02-28 10:14:06 +00:00
Zdenek Kabelac
696052b78e Limit max size of clvmd message
This could be seen as some sort of simple validation - it's not easy to
recognize a valid message for now - but we definitely do not want to
allocate a lot of megabytes in  clvmd memory locked daemon when broken
message gets in.

Size of 8000 is just selected for now - possibly there could be much
lower value put in.
2012-02-28 09:58:19 +00:00
Zdenek Kabelac
782a37e411 Do not send uninitilised bytes
Use struct initalizers to fill struct members and at the same time have
all unspecified members set to 0.
2012-02-28 09:53:55 +00:00
Zdenek Kabelac
5627fc8e7b Do not hide deallocation of buffer
As API is passing structures by value, do not leave
the function which created buffer and keeps valid pointer
look like it would be some memory leak and move
free of buffer from inner function - makes more obvious,
how is the memory management handled.
2012-02-27 11:49:16 +00:00
Zdenek Kabelac
c57a9960b5 Add FIXME for misuse in case of dm_event_mask enum.
Using enum for bitmask is not proper solution here.
2012-02-27 11:46:25 +00:00
Zdenek Kabelac
8918bf2430 Add some log_sys_errors to close() call 2012-02-27 11:28:47 +00:00
Zdenek Kabelac
75f8f3ce8b Nicer cleanup of excl_uuid hash
Since it on exit path, it's not a big difference,
but makes less noise in analyzer and valgrind.
2012-02-27 11:26:25 +00:00
Peter Rajnoha
ceec205594 Systemd is linux-specific - move the supporting code under the 'ifdef linux'.
Some 'defines' used in this specific code were already under an ifdef so this
patch just completes it.
2012-02-27 11:13:51 +00:00
Zdenek Kabelac
d2e33bed94 Add assert for oldname
Code cannot proceed if oldname would be NULL.
Since lvmetad currently doesn't use logging mechanism of lvm to report
internal errors - stay with current code style of lvmetad which uses
plain asserts for cases like this.
2012-02-27 10:19:00 +00:00
Zdenek Kabelac
25555737bd A bit more safe version of sprintf
Use just buffer size limit (it's used for debug only)
2012-02-27 10:17:06 +00:00
Zdenek Kabelac
0c35eb915c Move allocation after check for vgid
so there is no mem leak on this error path.
Also actually check if the hash exists.
2012-02-27 10:10:43 +00:00
Zdenek Kabelac
8df2c89cd4 Explicitely ignore result from sync_unlock()
Make it obvious to analyzer - we can't do anything better here anyway.
2012-02-27 10:02:17 +00:00
Zdenek Kabelac
7e25b8f932 Drop uname call, it's not used from gulm era. 2012-02-27 09:58:18 +00:00
Petr Rockai
98b4241b2f Improve error handling & reporting in common daemon code. 2012-02-26 08:46:28 +00:00
Petr Rockai
dc4a15bb69 Fix server-side leaks in lvmetad. 2012-02-24 00:24:37 +00:00
Petr Rockai
2a11eea2e1 Clean up the lvmetad state more thoroughly upon shutdown. 2012-02-24 00:11:59 +00:00
Petr Rockai
dc5ba5c392 Fix an error path in daemon_open. 2012-02-24 00:02:54 +00:00
Petr Rockai
3f694b1265 Couple of improvements in the daemon (common + lvmetad) code:
- some client-side memory leak fixes
- announce and check protocols and protocol versions
2012-02-23 23:52:11 +00:00
Zdenek Kabelac
71f3bbd53f Limit sscanf params with size
Make sure parsed string fits given char buffer.
2012-02-23 22:50:50 +00:00
Zdenek Kabelac
ba337a5f3e Remaing code suffling
Move declaration to the front of function to follow coding rules.
2012-02-23 22:23:12 +00:00
Zdenek Kabelac
b6c5ea358e Some reformating for lvmetad uddates
cleanup gcc warning,
use PRIu64
header cleanups
const pointer fixes.
2012-02-23 17:59:32 +00:00
Petr Rockai
52e8e908d6 Add a missed dependency that is required to pull in dameons/common in an early
part of the build.
2012-02-23 13:58:56 +00:00
Petr Rockai
ce700e70d2 We need daemons/common now even if the lvmetad server side is not built. 2012-02-23 13:41:11 +00:00
Petr Rockai
dae0822698 The lvmetad client-side integration. Only active when use_lvmetad = 1 is set in
lvm.conf *and* lvmetad is running.
2012-02-23 13:11:07 +00:00
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