1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 20:25:52 +03:00
Commit Graph

8827 Commits

Author SHA1 Message Date
Peter Rajnoha
b16235de96 cleanup: use 'define' for systemd runtime unit file directory 2014-03-14 15:57:44 +01:00
Peter Rajnoha
ada47c164a autoactivation: use VG read lock
The activation (including the refresh) should take the VG read lock
like the usual activation/refresh.
2014-03-14 12:10:52 +01:00
Zdenek Kabelac
58e812a13f tests: use DMEVENTD_PIDFILE
Test for compiled-in pidfile location
(so we are not based on assumption /var/run or /run link exists)
2014-03-14 11:16:24 +01:00
Peter Rajnoha
ca880a4f13 autoactivation: issue a VG refresh before autoactivation only if 'change' lvmetad flag is set
This prevents numerous VG refreshes on each "pvscan --cache -aay" call
if the VG is found complete. We need to issue the refresh only if the PV:
  - is new
  - was gone before and now it reappears (device "unplug/plug back" scenario)
  - the metadata has changed
2014-03-14 10:48:56 +01:00
Zdenek Kabelac
900cb6717b tests: quick update of location of pid file
Until better fix is put in - replace with /run.
2014-03-14 10:40:48 +01:00
Petr Rockai
551b6b7998 lvmetad: Fix pvmeta_old_{pvid,dev} logic when they are the same. 2014-03-14 10:09:16 +01:00
Marian Csontos
67c539f346 lvmetad: Fix previous commit
"%d" in buffer_append_vf is 64 bit wide. Using just `int` for the
variable will fetch more from va_list than intended and shifting
remaining arguments resulting in errors like:

    Internal error: Bad format string at '#orphan'
2014-03-14 08:09:37 +01:00
Petr Rockai
816197aaab lvmetad: Indicate whether pv_found caused the VG to change. 2014-03-14 03:08:19 +01:00
Petr Rockai
5eef269f77 lvmetad: Also return vgname in reply to pv_found requests. 2014-03-14 03:08:19 +01:00
Marian Csontos
a31ab7c171 man: Fix man page containing BUILDROOT
This breaks brew/koji as DESTDIR should not be contained in any file and
results in message like:

    + /usr/lib/rpm/check-buildroot
    /builddir/build/BUILDROOT/lvm2-2.02.106-0.311.el7.x86_64/usr/share/man/man8/lvm2-activation-generator.8:.B /builddir/build/BUILDROOT/lvm2-2.02.106-0.311.el7.x86_64/usr/lib/systemd/system-generators/lvm2-activation-generator
    Found '/builddir/build/BUILDROOT/lvm2-2.02.106-0.311.el7.x86_64' in installed files; aborting
    error: Bad exit status from /var/tmp/rpm-tmp.UfX2SX (%install)
2014-03-14 00:36:19 +01:00
Peter Rajnoha
2189d66a27 man: install lvm2-activation-generator man page only on make install_systemd_generators 2014-03-13 13:20:28 +01:00
Peter Rajnoha
031666ef66 man: add man page for lvm2-activation-generator 2014-03-13 13:01:06 +01:00
Zdenek Kabelac
c0f1eb5f0f dev_manager: check prohibited devices earlier
Reorder detection for internal device - since this test
is much simpler then target analysis, check it sooner.

Replace test for '68' with sizeof & ID_LEN

Add FIXME about device alias problem with is_reserved_lvname,
since this test fails on devices like /dev/dm-X
so we need to convert tests to UUID.
2014-03-12 19:38:34 +01:00
Zdenek Kabelac
b50b4471bd cleanup: drop unused define 2014-03-12 19:12:34 +01:00
Zdenek Kabelac
8b14ebb2f1 tests: another kernel with unusable kmem_check 2014-03-12 16:17:36 +01:00
Peter Rajnoha
bf42119b22 config: accept empty values for global/thin_disabled_features
Let's do this the other way round - this makes more logic than commit b995f06.
So let's allow empty values for global/thin_disabled_features where
such an empty value now means "none of this features are disabled".
2014-03-12 15:53:20 +01:00
Peter Rajnoha
b995f06abf config: mark global/thin_disabled_features as having no default value
The global/thin_disabled_features should be marked as having no default
value. Otherwise the output from 'lvm dumpconfig --type default' would
have 'thin_disabled_features=""' which will produce an error message
'Ignoring empty string in config file ...' if such output is feed
back to lvm.
2014-03-12 15:17:52 +01:00
Zdenek Kabelac
a2c64e21fd tests: check we are no reading pool device 2014-03-12 00:26:47 +01:00
Zdenek Kabelac
dd690d5fd1 tests: add inactive pool creation test 2014-03-12 00:25:59 +01:00
Zdenek Kabelac
4cc5c689b8 thin: add pool uuid suffix for pool volume
Even though we make pool volume as a public visible LV,
we still do not want tools to look at this volume.

While we do not create /dev/vg/lv link, device is still
accessible via /dev/mapper/vg-lv and there is no easy
way to recognize it's private without lvm2 metadata.

Enhance UUID with -pool suffix and directly skip
any LV with a suffix in  device_is_usable() call.

TODO: enhance other targets with this logic.
blkid may probably use same simple logic.
2014-03-12 00:16:27 +01:00
Zdenek Kabelac
8a60cbcf45 thin: always activate and deactive pool when creating
When we create thin-pool we have used trick to keep
volume active, but since we now support TEMPORARY flag,
we could just localy active & deactive metadata LV,
and let the thinpool through normal activation process.
2014-03-12 00:16:27 +01:00
Zdenek Kabelac
6a0d97a65c lvm: change build_dm_uuid API
Pass directly 'lv' into this build routine,
so we can eventually add more private UUID suffixes.
2014-03-12 00:16:20 +01:00
Zdenek Kabelac
4d64e91efd thin: do not check of empty pool with messages
The empty pool is also the pool which has yet queued list of messages
and transaction_id == 1.

Problem is exposed when pool is created inactive.

lvcreate -L10 -T vg/pool -an
lvcreate -V10 -T vg/pool
2014-03-12 00:15:22 +01:00
Zdenek Kabelac
1850a6e454 thin: fix pool_has_message return for NULL params
When pool_has_message() is queried with NULL lv and 0 device_id
it should just return 'true' when there is any message queued.
So it needs to return negative value dm_list_empty().

Since there is no user for this code path in code currently,
this bug has not been triggered.
2014-03-12 00:13:21 +01:00
Peter Rajnoha
7574b3bc80 autoreconf: sync configure with current configure.in 2014-03-11 16:32:02 +01:00
Zdenek Kabelac
6c892be4a5 clvmd: fix the len setting in last commit
When theoretically sending 0 length buffer, ensure 0 is returned.
2014-03-10 12:35:44 +01:00
Zdenek Kabelac
5dc9402774 tests: dmeventd valgrind testing 2014-03-10 12:24:11 +01:00
Zdenek Kabelac
c7262d5b38 tests: aux adds kill_sleep_kill_
Move common code to subfunction
2014-03-10 12:24:11 +01:00
Zdenek Kabelac
1c18fc42ec tests: drop unused make_ioerror 2014-03-10 12:24:11 +01:00
Zdenek Kabelac
6cc75d1497 tests: workaround bash bug
Seems new bash4.3 is somewhat buggy
https://bugzilla.redhat.com/show_bug.cgi?id=1074202

Put in cheap workaround for now.
2014-03-10 12:24:10 +01:00
Zdenek Kabelac
4eed2c8142 tests: skip valgrind testing when assigned to 0
When LVM_VALGRIND_CLVMD/LVMETAD is set to 0  skip testing.
(Proviosly any value caused to run valgrind testing,
so now '0' skips testing))
2014-03-10 12:24:10 +01:00
Zdenek Kabelac
41e1b12e03 tests: skip another kernel
This kernel has still buggy kmem_cache debugging so skip it for raid456.
2014-03-10 12:24:10 +01:00
Zdenek Kabelac
d913fcbd46 tests: improve wait for open
Add loop to detect open device from 'sleep <'
2014-03-10 12:24:10 +01:00
Zdenek Kabelac
fa23234e71 tests: reuse existing check dev_md5sum
Create md5sum in reusable way and use exiting check function.
2014-03-10 12:24:10 +01:00
Zdenek Kabelac
d080abf7d6 cleanup: dmeventd convert multiline to single line
Instead of doing multiple different calls, select
stream within a condition.

Replace fprintf with fputc for '\n'
2014-03-10 12:24:10 +01:00
Zdenek Kabelac
7b17dfed69 cleanup: dmeventd code simplified
Improve readbility of code.
2014-03-10 12:24:10 +01:00
Zdenek Kabelac
341055ddb3 cleanup: clvmd use struct initializers
Simplify code, and use compiler capability to
initilize struct members on its own.
2014-03-10 12:24:10 +01:00
Zdenek Kabelac
c44ede31a3 cleanup: clvmd use else if
When string already matches, skip rest of tests.
2014-03-10 12:24:09 +01:00
Zdenek Kabelac
2cfe0840d2 cleanup: clvmd assign NULL to pointers
Use NULL when assigning to void*.
2014-03-10 12:24:09 +01:00
Zdenek Kabelac
c824369fbd cleanup: clvmd indent changes
Improve readbility of clvmd code.
Remove some unneeded braces.
2014-03-10 12:24:09 +01:00
Zdenek Kabelac
109564d6a5 cleanup: clvmd simplify loops
Rewrite write loops to be more readable.
2014-03-10 12:24:09 +01:00
Zdenek Kabelac
3d23404081 cleanup: clvmd rewrite send_message
Improve readability of code and make it clear what it tries
to achieve.
2014-03-10 12:24:09 +01:00
Zdenek Kabelac
cbca815dc4 cleanup: clvmd reindent lock_vg code
Code had wrong indent level, improve readability.
2014-03-10 12:24:09 +01:00
Zdenek Kabelac
7a6c0e2425 dmeventd: wakeup timeout thread earlier
When the last entry in the timeout queue is unregistered,
wakeup sleeping condition, so the thread is deleted earlier.
So the thread resource is release earlier.

Also when monitored with tools like valgrind this eliminites reported
leak.
2014-03-10 12:24:07 +01:00
Zdenek Kabelac
2a9b62c7f9 dmeventd: remember number of log disablings
Individual events are handled through separate threads,
so once we have more then a single thread in this eventwait
sleeping, we got race on the dm_log setting, since
if one event is timeout out on alarm, while another is still waiting,
then dm log has been restored to NULL and the next sigalarm
has been reported as error.

Fix it by introducing counter which is protected via mutex,
and only when the last event is released, logging is restored.

TODO: libdm seems to have some static vars which may audit
for this type of use.
2014-03-10 12:22:47 +01:00
Zdenek Kabelac
460c19df62 clvmd: fix memleak on exit
This patch will releases allocated private resources from
startup. Needs previous dm_zalloc patch to ensure unset
private pointer is NULL.

TODO: check on real cluster.
2014-03-10 12:21:32 +01:00
Zdenek Kabelac
38ce06e448 clvmd: use dm_zalloc for socket allocation
Instead of doing individual settings for struct members,
ensure whole struct is in defined state.
2014-03-10 12:20:49 +01:00
Peter Rajnoha
bfffccca94 config: keep config paths with variable names properly marked on output 2014-03-07 18:04:02 +01:00
Peter Rajnoha
eeff7729d9 config: use small local static buffer instead of mempool for temporary config path
We can't use mempool for temporary variable for configuration path inside
find_config_tree_* functions since these functions can use the mempool
themselves deeper in the code and we can free mempool chunks only from
top to bottom which is not the case here (some default string
configuration values can be allocated from the mempool).
2014-03-07 17:50:01 +01:00
Peter Rajnoha
7409009a20 cleanup: remove superfluous slash in default cache dir path 2014-03-07 13:03:09 +01:00