Petr Rockai [Mon, 25 Jul 2011 15:51:51 +0000 (15:51 +0000)]
lvmetad: Check integrity of multiple metadata copies, i.e. ensure that seqno
equality implies metadata equality. Signal error in response to any update
requests that try to overwrite metadata without providing a higher seqno.
Compare also file size to detect changed config file
Clvmd detects modifed config file before it takes lv_lock.
If the config file is changed rapidly - the change was ignored within
a seocnd ranged. This patch adds also compare of file size.
So change like some flag for 0 to 1 would pass unnoticed - but
it's quick fix for failing test suite.
Petr Rockai [Wed, 20 Jul 2011 21:33:41 +0000 (21:33 +0000)]
lvmetad: Obliterate vg_status by returning the same information from
update_pv_status, saving a dozen lines of code and execution time of one
walkthrough of the PV list.
Petr Rockai [Wed, 20 Jul 2011 21:23:43 +0000 (21:23 +0000)]
First stab at making lvmetad-core threadsafe. The current design should allow
very reasonable amount of parallel access, although the hash tables may become
a point of contention under heavy loads. Nevertheless, there should be orders
of magnitude less contention on the hash table locks than we currently have on
block device scanning.
Petr Rockai [Wed, 20 Jul 2011 16:46:40 +0000 (16:46 +0000)]
Make lvmetad also report VGID in reply when adding a PV without MDAs (this
obviously only works for VGs that already had at least some MDA discovered).
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}).