Zdenek Kabelac [Fri, 2 Mar 2012 21:53:17 +0000 (21:53 +0000)]
Support 16GB for thin pool metadata
Add some hack math to allow 16GB devices to be passed as thinpool metadata.
Since kernel has put in limit to not allow which are just bigger then
some predefined constant in kernel but not matching 16GB so any device bigger
is rejected.
FIXME: Current code still might need more tweaks to be more generic.
Alasdair Kergon [Fri, 2 Mar 2012 20:46:36 +0000 (20:46 +0000)]
Pass struct device around internally rather than dev_t.
Add 3rd daemon return state "unknown" for lookups that are carried out
successfully but don't find the item requested.
Avoid issuing error messages when it's expected that a device that's
being looked up in lvmetad might not be there.
Zdenek Kabelac [Fri, 2 Mar 2012 20:18:25 +0000 (20:18 +0000)]
Merge metadata size checking
Move the code for poolmetadatasize operation into one place.
Report override for minimum and maximum size.
Drop _read_thin_params function its error reporting is handled elsewhere.
Zdenek Kabelac [Fri, 2 Mar 2012 17:25:21 +0000 (17:25 +0000)]
Fix estimation of pool metadata device size
If no size was give the later added minimal size check efectively
disable this code. Also the argument for size now must be kept
in sector_size, so adding division by SECTOR_SIZE (moved into
a const expression)
Alasdair Kergon [Fri, 2 Mar 2012 16:58:41 +0000 (16:58 +0000)]
Allow multiple device names with pvscan --lvmetad.
Hold global lock in pvscan --lvmetad. (This might need refinement.)
Add PV name to "PV gone" messages.
Adjust some log message severities. (More changes needed.)
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.
Zdenek Kabelac [Thu, 1 Mar 2012 10:07:38 +0000 (10:07 +0000)]
Check for version string buffer
Since lvm seems to call driver_version(NULL, 0) this would lead
to crash. Though the combination of the code is probably very hard to hit.
If the user doesn't supply version buffer, just skip printing to buffer.
Zdenek Kabelac [Wed, 29 Feb 2012 22:08:57 +0000 (22:08 +0000)]
Wipe initial 4KiB for non-zeroed thin volumes
If the thin pool has disabled zeroing (created with -Zn), we at least
clear initial 4KiB of such thin volume (provisions 1st block).
If lvcreate is executed with '-an' command will abort (same way like we for
normal LV - however for normal LV option -Zn may skip clearing completely,
for thin volumes this option is not supported (applies only for pools).
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.
Zdenek Kabelac [Tue, 28 Feb 2012 11:06:56 +0000 (11:06 +0000)]
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).
Zdenek Kabelac [Tue, 28 Feb 2012 10:06:53 +0000 (10:06 +0000)]
Duplicate standard in/out descriptors for daemon
Addressing somewhat tricky bug here.
Since stdin,stdout,stderr were closed it's been occasionally possible to
see some unexpected messages to be flowing into a clvmd and generating some
randomly sized allocation of many megabytes. Since the message was not
being generated by standard send_message() construction, after some more
testing it apperead to be a debug log message - thus something has flown
to local socket opened on strandard out descriptor.
To fix the issue - use standard file descriptor duplication code for daemons.
For making easier debugging of polling daemon - developer might want to recompile
without modifition of standard file descriptors.
Zdenek Kabelac [Tue, 28 Feb 2012 09:58:19 +0000 (09:58 +0000)]
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.
Zdenek Kabelac [Mon, 27 Feb 2012 11:49:16 +0000 (11:49 +0000)]
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.
Zdenek Kabelac [Mon, 27 Feb 2012 11:45:05 +0000 (11:45 +0000)]
Use unsigned type for bitmask
Using report_type_t for bitmask is not correct, since we have not defined types
for all bit combinations - so switching to unsigned type, since values of
report_type_t enum are unsigned.
Zdenek Kabelac [Mon, 27 Feb 2012 11:40:58 +0000 (11:40 +0000)]
Just code move of hash initialization in front of function
Make sure both hash tables are initialized before _read_sections() call.
Presents no functional change (since PV scan phase was not adding LV hashes),
but makes the code easier to handle mem failing case, and static analyzer is
hapier as well.
Zdenek Kabelac [Mon, 27 Feb 2012 11:35:59 +0000 (11:35 +0000)]
Add stack traces for lock_vol failures
Adding at least stack traces with some FIXMEs for cases,
where we might want to do something cleaver - maybe fail command
or give user hints something is not going well ?
For remote_backup is stack probably 'good' enough for now.