Petr Rockai [Mon, 18 Jul 2011 14:42:44 +0000 (14:42 +0000)]
Improve format_buffer in daemon-shared.c, adding block formatting in addition
to string/integer (this propagates to the *simple* family of request/response
functionality).
Petr Rockai [Mon, 18 Jul 2011 14:34:33 +0000 (14:34 +0000)]
Revert the #include changes. Need to fix this at the #include site for now, and
eventually refactor the way we structure #includes in the all of the library.
where the naming is left completely on lvm.
(Commited code has been different version of test).
So here it should be able to figure out new free name and create a new LV.
Petr Rockai [Mon, 11 Jul 2011 12:13:07 +0000 (12:13 +0000)]
Fix t-vgreduce-usage to stop relying on the persistent cache not seeing a
device that has been brought back from the dead: this sometimes fails with
clvmd (the cache is updated "too soon"). Instead, force a pvscan and rely on an
up-to-date cache as usual.
Move snapshot deactivation logic into lib/activate, fixing the
teardown sequence. (Previously the snapshot was deactivated while its
origin was active and before its removal was committed to disk, so
restarting after a crash at the point would leave corruption.)
Always perform preload logic before suspending - not only in the case when we
have precommitted metadata. (Necessary to avoid loading tables
while suspend in lvchange --refresh.)
Fix conditions using no_merging: only those using lv_is_merging_cow() should
have been converted, not pure lv_is_cow ones.
(Merging has no impact on how the pre-merged cow segment itself is loaded.)
Add framework for validation of ioctls. Doesn't do any checks yet.
dmsetup --checks
libdevmapper: dm_task_enable_checks()
lvm.conf: activation/checks=1
Zdenek Kabelac [Thu, 30 Jun 2011 09:24:58 +0000 (09:24 +0000)]
Report internal error when parameters are missing on table load
When some target is passing empty parameters to some dm target,
report this as an internal error to better catch some broken
table construction (some mirror conversions seem to be doing
this for now).
The conditional is not just unnecessary, it would have been wrong. The code
is suppose to be checking if the 'splitmirrors_ARG' is negative, but it
instead is checking 'mirrors_ARG'. Rather than changing the argument being
checked, I've pulled the check entirely because 'splitmirrors_ARG' is already
guarenteed to not be negative by virtue of the fact that it is a 'int_arg'.
Negative values will be caught in _process_command_line().
Alasdair Kergon [Tue, 28 Jun 2011 00:38:26 +0000 (00:38 +0000)]
Change to still sync with udev (to test waiting for rules) then to verify udev
operations like it used to (which will perform them on systems with
non-std dev dirs where test udev rules aren't installed).
Alasdair Kergon [Tue, 28 Jun 2011 00:23:06 +0000 (00:23 +0000)]
Remove enforcement of udev verification when using non-standard /dev location.
If you change the dev dir, it's your responsibility to adjust udev rules
or tell lvm not to use udev too.
Alasdair Kergon [Mon, 27 Jun 2011 23:43:04 +0000 (23:43 +0000)]
Move _set_lvm_fallback into toolcontext, fix string comparison (/devtest
matched /dev) and note that function should go anyway as it can be
overriding a valid config.
Alasdair Kergon [Mon, 27 Jun 2011 21:43:58 +0000 (21:43 +0000)]
Move udev_only logic inside stacked node op code.
(We still need to treat add+readhead+del as a no-op.)
Rename udev_fallback to verify_udev_operations.
Rename --udevfallback to --verifyudev
Petr Rockai [Mon, 27 Jun 2011 14:03:58 +0000 (14:03 +0000)]
Add int/str lookup routines specific to the reply (in client) and request (in
server) for nicer-looking code (thin wrapping around find_config_{int,str}).
Alasdair Kergon [Fri, 24 Jun 2011 19:33:41 +0000 (19:33 +0000)]
Return immediately dm_lib_exit() if called more than once.
(Avoiding calling it twice would involve some untangling.)
Decrement the new suspended_counter if removing a suspended device.
Fix to preserve exclusive activation of mirror while up-converting.
When an LVM mirror is up-converted (an additional image added), it creates
a temporary mirror stack. The lower-level mirror in the stack that is
created was not being activated exclusively - violating the exclusive nature
of the original mirror. We now check for exclusive activation of a mirror
before converting it, and if found, we ensure that the temporary mirror
is also exclusively activated.
Mirrors used to be created by first creating a linear device and then adding
the other images plus the log. Now mirrors are created by creating all the
images in one go and then adding the log separately. The new way ran into
the condition that cluster mirrors cannot change the log type (in the case
of creation, from core -> disk) while the mirror is not active. (It isn't
active because it is in the process of being created.) The reason this
condition is in place is because a remote node may have the mirror active, and
we don't want to alter the log underneath it.
What we really needed was a way of checking if the mirror was active remotely
but not locally, and in that case do not allow a change of the log. I've added
this check, and cluster mirrors can now be created again.
Peter Rajnoha [Wed, 22 Jun 2011 12:56:02 +0000 (12:56 +0000)]
Add check for library fallback in _deactivate_node.
This fn calls rm_dev_node directly - an exceptional case. It needs to check
the DM_UDEV_DISABLE_LIBRARY_FALLBACK flag directly (it's called in dm_task_run
normally where it's checked already).
Peter Rajnoha [Fri, 17 Jun 2011 14:50:53 +0000 (14:50 +0000)]
Disable udev fallback by default and add activation/udev_fallback to lvm.conf.
We've used udev fallback code till now to check whether udev
created/removed the entries in /dev correctly and if not,
a repair was done (giving a warning messagea about that).
This patch adds a possibility to enable this additional check
and subsequent fallback only when required (debugging purposes
mostly) and trust udev completely.
So let's disable the fallback code by default and add a new
configuration option "activation/udev_fallback".
(The original code for creating the nodes will still be used
in case the device directory that is set in lvm.conf differs
from the one that udev uses and also when activation/udev_rules
is set to 0 - otherwise we would end up with no nodes/symlinks
at all)
Zdenek Kabelac [Fri, 17 Jun 2011 14:39:10 +0000 (14:39 +0000)]
Code move of vg_mark_partial() up in stack
It's useful to keep the partial flag cached - so just move the call
for vg_mark_partil_lvs() into import_vg_from_config_tree() so it gets
evaluated before it goes through the lvmcache.
This patch should not present any functional change.
Note: It is rather temporal solution - proper place is probably inside the
'read' call back - but needs some more discussion.
For now using this minor hack.