1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

8985 Commits

Author SHA1 Message Date
Zdenek Kabelac
589983a257 cleanup: include stdarg.h where needed.
Avoid dependency on implicit inclusion of stdarg.h with
libdevmapper.h.
2014-04-18 16:38:50 +02:00
Zdenek Kabelac
b7741f0a83 libdaemon: header cleanup
Ensure  daemon-io.h is used as a generic header included
with configure defines before other headers.
(In future all lvm2 libraries should settle on a single lib.h header)
Rename couple defines to better match header file names.
2014-04-18 16:38:49 +02:00
Zdenek Kabelac
e552824dc0 makefiles: move subdir into same section
Just shift few lines
2014-04-18 16:38:49 +02:00
Zdenek Kabelac
07274f3dd4 makefiles: drop linking of deamon libs to plugins
Daemon lib is linked into lvm2cmd library.
2014-04-18 16:38:49 +02:00
Zdenek Kabelac
2b748e3118 makefiles: compile files on make
Make install should install already compiled/generated files.
2014-04-18 16:38:49 +02:00
Zdenek Kabelac
1af05a7a16 makefiles: clear targets in with make clean
Make clean usually cleans all compiled files.
Make distclean cleans configure generated files
2014-04-18 16:38:48 +02:00
Zdenek Kabelac
4955dae4be makefiles: wait till include is populated
Since libdaemon needs configure.h header, wait forl links.
2014-04-18 16:38:48 +02:00
Zdenek Kabelac
db0045dfc9 devmapper-event: always initialize timeout
Before calling select, always set all struct members of timeout.
2014-04-18 16:38:48 +02:00
Zdenek Kabelac
08e7de986c dmeventd: check for list size within lock
Move check for _thread_registry list size behind mutex.
Use alloca() instead of buffer[count] (they are the same anyway)
2014-04-18 16:38:48 +02:00
Zdenek Kabelac
0e05e1cf6c asprintf: fix test for error result
On error this function returns -1. Since the functions however
do not propagate error upward, it's rather cleanup change.
2014-04-18 16:38:47 +02:00
Zdenek Kabelac
0b6d6bfb77 thin: dmeventd plugins support more minors
Kernel supports upto 1M (20bit) minors.
TODO: convert to hash to reduce memory requirements
2014-04-18 16:38:47 +02:00
Zdenek Kabelac
47a60369a0 unknown: fix mempool used for name allocation
Use cmd libmem mempool for name allocation, since mem mempool
is released after each clvmd command.
2014-04-18 16:38:47 +02:00
Alasdair G Kergon
b5f8f452ac tools: Add --readonly support.
Offer lock-free access to display virtual machine or clustered VG metadata
while it might be in use.
2014-04-18 02:46:34 +01:00
Alasdair G Kergon
17e304e0ac metadata: Fix unlock on VG recovery error path.
If lock conversion failed it tried to unlock VG that was no longer locked.
2014-04-18 02:27:16 +01:00
Alasdair G Kergon
177ece01a9 reports: Use X for unknown LV attr when no dm.
It's safer not to tell people an LV is inactive when we aren't sure.
2014-04-18 02:23:39 +01:00
Alasdair G Kergon
e8a3ba1865 pvscan: Use lvmetad_used().
Config variables that are processed during setup prior to calling into
particular tools must not be accessed directly afterwards in case the
values already got overridden.

_process_config() already used the tests I'm removing here to call
lvmetad_set_active() and set up lvmetad_used().
2014-04-18 02:13:46 +01:00
Peter Rajnoha
702180b30c configure: use configure's --enable-udev-systemd-background-jobs by default
This should be the preferred way of configuring lvm2 for udev/systemd
since otherwise one can end up with the processes run from udev (the
pvscan we run for lvmetad update on events) to be killed prematurely
and this can end up with LVM volumes not activated in the end.
2014-04-16 11:33:44 +02:00
Peter Rajnoha
18caa562fe lvmdump: list also inactive units for lvmdump -s 2014-04-15 15:43:20 +02:00
Peter Rajnoha
a6763c64a7 lvmdump: add -s to gather system info and context (currently systemd-related only)
This is sort of info we always ask people to retrieve when
inspecting problems in systemd environment so let's have this
as part of lvmdump directly.

The -s option does not need to be bound to systemd only. We could
add support for initscripts or any other system-wide/service tracking
info that can help us with debugging problems.
2014-04-15 15:27:30 +02:00
Peter Rajnoha
704609b17e profiles: comment out thin_pool_chunk_size in default.profile
By default, the thin_pool_chunk_size is automatically calculated.
When defined, it disables the automatic calculation. So to be more
precise here, we should comment it out for the default.profile.

Also, "lvm dumpconfig --type profilable" was used here to generate
the default.profile content. This will be done automatically in the
future once we have the infrastructure for this in (see also
https://bugzilla.redhat.com/show_bug.cgi?id=1073415).
2014-04-15 10:15:38 +02:00
Alasdair G Kergon
8980592514 alloc: Correct existing use of positional fill.
Perform two allocation attempts with cling if maximise_cling is set,
first with then without positional fill.

Avoid segfaults from confusion between positional and sorted sequential
allocation when number of stripes varies as reported here:
https://www.redhat.com/archives/linux-lvm/2014-March/msg00001.html
2014-04-15 02:34:35 +01:00
Alasdair G Kergon
1bf4c3a1fa alloc: Introduce A_POSITIONAL_FILL.
Set A_POSITIONAL_FILL if the array of areas is being filled
positionally (with a slot corresponding to each 'leg') rather
than sequentially (with all suitable areas found, to be sorted
and selected from).
2014-04-15 01:13:47 +01:00
Alasdair G Kergon
c9a8264b8b alloc: Access alloc_parms from alloc_state.
alloc_parms is constant while allocating.
2014-04-15 01:05:34 +01:00
Zdenek Kabelac
3c82a37aee tests: correct test condition
Abort loop when PIDFILE is gone
2014-04-14 14:55:14 +02:00
Zdenek Kabelac
92ee51a4c3 tests: check there is really pvmove lv
Since the kill may take various amount of time,
(especially when running with valgrind)
check it's really pvmoved LV.

Restore initial restart of clvmd - it's currently
broken at various moments - basically killed lvm2
command may leave clvmd and confusing state leading
to reports of internal errors.
2014-04-14 13:02:28 +02:00
Zdenek Kabelac
4d48577ab9 tests: implement lv_attr_bit
Add easy check function for cheking lv_attr bits
2014-04-14 13:02:28 +02:00
Zdenek Kabelac
1d803ee980 cleanup: corrent indent level 2014-04-14 13:02:28 +02:00
Zdenek Kabelac
d896abc705 cleanup: clvmd drop unused enum state 2014-04-14 13:02:27 +02:00
Zdenek Kabelac
e2f194952a cleanup: clvmd reindent local_pipe_callback
Move !node_up check in front and reindent
rest of the function to the left.
2014-04-14 13:02:27 +02:00
Zdenek Kabelac
eccc50d861 clvmd: use thread-safe ctime_r when debugging
Use thread friendly version of ctime
TODO:should be probably replaced with strftime()
2014-04-14 13:02:25 +02:00
Zdenek Kabelac
639983b6b7 clvmd: skip adding reply when finished
Prior adding new reply to the list, check
if the reply thread is not already finished.
In that case discard adding message
(which would otherwise be leaked).
2014-04-14 13:01:42 +02:00
Zdenek Kabelac
7236b92857 clvmd: improve mutex usage in request_timed_out
Use mutex to access localsock values, so check
num_replies when the thread is not yet finished.

Check for threadid prior the mutex taking
(though this check is probably not really needed)
2014-04-14 13:00:51 +02:00
Zdenek Kabelac
7075656034 clvmd: drop reply_mutex
Added complexity with extra reply mutex is not worth the troubles.
The only place which may slightly benefit from this mutex is timeout
and since this is rather error case - let's convert it to
localsock.mutex and keep it simple.
2014-04-14 12:59:07 +02:00
Zdenek Kabelac
6115c0d112 clvmd: set finished flag with mutex
Setting this variable needs to be protected with mutex.
2014-04-14 12:58:28 +02:00
Zdenek Kabelac
cc0096ebdd clvmd: move mutex init and detroy
Move the pthread mutex and condition creation and destroy
to correct place right after client memory is allocatedd
or is going to be released.

In the original place it's been in race with lvm thread
which could have still unlock mutex while it's been already
destroyed.
2014-04-14 12:57:39 +02:00
Zdenek Kabelac
91f4e09b48 clvmd: fix test mode race
When TEST_MODE flag is passed around the cluster,
it's been use in thread unprotected way, so it may have
influenced behaviour of other running parallel lvm commands
(activation/deactivation/suspend/resume).

Fix it by set/query function only under lvm mutex.
For hold_un/lock function calls check lock_flags bits directly.
2014-04-14 12:55:46 +02:00
Zdenek Kabelac
bd3e44643d memlock: ignore more libraries
Extend the list of ignored libraries. Since we do not
use those libraries during suspend, skip their locking.
2014-04-14 12:53:07 +02:00
Zdenek Kabelac
84ff3ae703 pvmove: remove locked flag from error pvmove0
When pvmove0 is finished, it replaces temporarily pvmove0
with error segment, however in this case, pvmove0 remains
unremovable in case pvmove --abort is interrupted in this
moment - since it's not a pvmove anymore and normal
lvremove can't be used to remove LOCKED lv.
2014-04-14 12:52:32 +02:00
Zdenek Kabelac
45f45c9932 polldaemon: ret invalid cmd for negative interval
Negative intervals are not supported.
2014-04-14 12:47:14 +02:00
Alasdair G Kergon
a8d63994ea alloc: Refactor area reservation code.
No functional changes intended to be included in this patch.
2014-04-10 20:48:59 +01:00
Alasdair G Kergon
6320c3b905 post-release 2014-04-10 17:13:27 +01:00
Alasdair G Kergon
2043f8c729 pre-release 2014-04-10 16:28:28 +01:00
Peter Rajnoha
35721ee134 tests: add test for pvcreate --dataalignment --dataalignmentoffset --restorefile compatibility
Also, avoid division by zero in the pvcreate's param validation
in case someone supplies "pvcreate --dataalignment 0".
2014-04-10 15:02:35 +02:00
Peter Rajnoha
05eb6a167e tests: add separate test file for bootloader area support and enhance tests
Enahnce bootloader area test to check whether restoring values from
backup works correctly.
2014-04-10 14:18:59 +02:00
Peter Rajnoha
6c79556f4f pvcreate: fix ignored --dataalignment/dataalignment offset for pvcreate --restorefile
There were two bugs before when using pvcreate --restorefile together
with data alignment and its offset specified:

  - the --dataalignment was always ignored due to missing braces in the
    code when validating the divisibility of supplied --dataalignment
    argument with pe_start which we're just restoring:

	if (pp->rp.pe_start % pp->data_alignment)
		log_warn("WARNING: Ignoring data alignment %" PRIu64
			 " incompatible with --restorefile value (%"
			 PRIu64").", pp->data_alignment, pp->rp.pe_start);
        pp->data_alignment = 0

    The pp->data_alignment should be zeroed only if the pe_start is not
    divisible with data_alignment.

  - the check for compatibility of restored pe_start was incorrect too
    since it did not properly count with the dataalignmentoffset that
    could be supplied together with dataalignment

The proper formula is:

  X * dataalignment + dataalignmentoffset == pe_start

So it should be:

  if ((pp->rp.pe_start % pp->data_alignment) != pp->data_alignment_offset) {
	...ignore supplied dataalignment and dataalignment offset...
  }
2014-04-10 13:43:46 +02:00
Peter Rajnoha
b45d2768a8 tests: add some coverage for bootloader areas 2014-04-09 15:44:26 +02:00
Peter Rajnoha
10e10cfa4f lvmetad: fix lost bootloader area information
The refactoring made by 732859d21f
caused this. The former "ea" was not renamed to "ba" and we used
incorrect tree node name to search for the value.
2014-04-09 14:53:45 +02:00
Zdenek Kabelac
87e559f1ec tests: check prohibited names 2014-04-08 11:00:16 +02:00
Zdenek Kabelac
bfbf6b7c12 cleanup: libdm drop already zeroed elements
Drop zeroing of zalloc-ed memory.
2014-04-08 11:00:16 +02:00
Zdenek Kabelac
a41ab41b70 cleanup: reindent return
Since the return here is the only path, reindent for readability.
2014-04-08 11:00:16 +02:00