Peter Rajnoha [Wed, 14 Mar 2012 15:51:51 +0000 (15:51 +0000)]
Use SD_ACTIVATION env. var. in systemd units to better detect systemd in use.
LISTEN_PID and LISTEN_FDS environment variables are defined only during systemd
"start" action. But we still need to know whether we're activated during
"reload" action as well - we use the reload action to call "dmeventd -R"/"lvmetad -R"
for statefull daemon restart. We can't use normal "restart" as that is simply
composed of "stop" and "start" and we would lose any state the daemon has.
Zdenek Kabelac [Mon, 12 Mar 2012 14:40:41 +0000 (14:40 +0000)]
Better structure layout for device_info
Save some relocation entries and use directly char[].
Since we do not need yes more then 127 partitions per device, use just int8_t.
Move lvm_type_filter_destroy into local static function.
Zdenek Kabelac [Mon, 12 Mar 2012 14:24:15 +0000 (14:24 +0000)]
Improve harness code
Support timestamping with harness - using VERBOSE=2
Fix also logging in several situation
(i.e. continue logging multiple test in VERBOSE mode,
do not coredump with empty output).
Zdenek Kabelac [Mon, 12 Mar 2012 14:15:04 +0000 (14:15 +0000)]
Fix error path for create_toolcontext
Never return unfinished toolcontext - since error path is hit on
various stages of initialization we cannot leave it partially uninitialized,
since we would need to spread many more test across the code for config_valid.
Instead return NULL and properly release udev library resources as well.
Peter Rajnoha [Mon, 12 Mar 2012 08:59:55 +0000 (08:59 +0000)]
Detect the lvm binary path in lvmetad udev rules.
We can't use 'DM_SBIN_PATH'. This one is set only for DM devices but not
for all block devices - the pvscan is run on all relevant block devices!
This LVM_SBIN_PATH (as well as DM_SBIN_PATH) detection should be removed
eventually but for upstream solution, we still have to do that as there are
known cases where the binaries are put either in /sbin or /usr/sbin
(some installation systems, initrd systems etc.).
Zdenek Kabelac [Tue, 6 Mar 2012 09:22:02 +0000 (09:22 +0000)]
Fix warn message and update man page
Fix regression in man page. The chunk size is in kilobyte units on command line
input though in the source code we work with sector size unit
so make it clear in the man page.
Update chunksize for thin pool in man page - it's max value is 1024M == 1G.
Fix warning range message to show proper max value.
Zdenek Kabelac [Mon, 5 Mar 2012 14:19:13 +0000 (14:19 +0000)]
Fit thin pool metadata into 128MB
If the lvcreate may decide some automagical values for a user,
try to keep the pool metadata size into 128MB range for optimal
perfomance (as suggested by Joe).
So if the pool metadata size and chunk_size were not specified,
try to select such values they would fit into 128MB size.
Zdenek Kabelac [Mon, 5 Mar 2012 14:15:50 +0000 (14:15 +0000)]
Improve warning
Use thin_dump --repair suggestion in log error message
and use just warning on deactivation path without repair info
(since node has been deactivated).
Also check whether there is not 16 args for thin_check configured.
Peter Rajnoha [Mon, 5 Mar 2012 12:48:12 +0000 (12:48 +0000)]
Check for multiple mangled names in auto mangling mode.
Auto mode can't deal with multiple mangled names. We can do that while working
in hex mode, but in auto mode, this would lead to device name ambiguity.
Peter Rajnoha [Mon, 5 Mar 2012 12:43:03 +0000 (12:43 +0000)]
Check whether device names are properly mangled on ioctl return.
Be more strict when unmangling names on ioctl return - require the name to be
properly mangled in 'auto' and 'hex' mode. There really should not be any
blacklisted character since the names should be renamed already (by means of
renaming it directly or running 'dmsetup mangle' for automatic rename).
Zdenek Kabelac [Sun, 4 Mar 2012 17:40:59 +0000 (17:40 +0000)]
Validate udev structures
Avoid using NULL pointers from udev. It seems like some older versions of udev
were improperly returning NULL in some case, so do not silently break here,
and give at least a warning to the user.
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.