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

8805 Commits

Author SHA1 Message Date
Peter Rajnoha
630e0af14e cleanup: move _get_def_array_values fn
So we can use reuse it for the code that will follow...
2014-03-24 15:20:19 +01:00
Zdenek Kabelac
c595b20e56 dev-swap: use SECTOR_SHIFT 2014-03-22 20:43:05 +01:00
Zdenek Kabelac
936bfeb8de dev-swap: detect swap signature on devices smaller then 2MB
Smallest supported size for swap device is 40KB, however current
test skipped devices smaller then 4096 sectors (2MB).

Since page is in bytes, convert it to sectors before comparing
with device size (in sectors).
2014-03-22 20:36:14 +01:00
Zdenek Kabelac
93d77455ea WHATS_NEW update 2014-03-21 22:29:28 +01:00
Zdenek Kabelac
c0c55846b0 tests: wait for clvmd.pid file
Just like with dmeventd and lvmetad.
Do few indent changes around.
2014-03-21 22:29:28 +01:00
Zdenek Kabelac
8b1916fd5a tests: simplify 2014-03-21 22:29:28 +01:00
Zdenek Kabelac
de5683d8d9 tests: add quotes around device paths 2014-03-21 22:29:27 +01:00
Zdenek Kabelac
01efb20bdb cleanup: clvmd add more info debug message 2014-03-21 22:29:27 +01:00
Zdenek Kabelac
0d449fe183 cleanup: clvmd uses struct initializers
Code easier to read
2014-03-21 22:29:27 +01:00
Zdenek Kabelac
9196274c1e cleanup: clvmd zombie removal loop
Simplier code to start scan from the next node,
and remove matching pipe client.
2014-03-21 22:29:27 +01:00
Zdenek Kabelac
5740c00f3b cleanup: clvmd reindent read_from_local_sock
Shift indent of else branch to right since
error path returns in the front.
(Simplier to read)
2014-03-21 22:29:26 +01:00
Zdenek Kabelac
dd17286c90 cleanup: clvmd indent change
Plain indent changes.
2014-03-21 22:29:26 +01:00
Zdenek Kabelac
0b79979bb9 cleanup: clvmd dump_messages 2014-03-21 22:29:26 +01:00
Zdenek Kabelac
f8cd435cd8 cleanup: clvmd update log_error
Drop \n from log_error() and add '.'
2014-03-21 22:29:26 +01:00
Zdenek Kabelac
4c97ea2ce5 cleanup: clvmd drop goto 2014-03-21 22:29:25 +01:00
Zdenek Kabelac
7d49c33ffc cleanup: clvmd skip reset of null pointer 2014-03-21 22:29:25 +01:00
Zdenek Kabelac
bf19c6be2c cleanup: clvmd move destroy_lvhash into main
Keep destruction code path consistent and simple and
destroy lvhash in the place it's been created.
Also issue debug message from a single place.
2014-03-21 22:29:25 +01:00
Zdenek Kabelac
1ee8688de0 cleanup: memlock line indent 2014-03-21 22:29:25 +01:00
Zdenek Kabelac
46ae028cd3 singlenode: reset pointer when hash is destroyed
Just keep pointer consistent.
2014-03-21 22:29:25 +01:00
Zdenek Kabelac
7041c8bf51 clvmd: drop dead code
Since pipe_client has been already reset to NULL,
remove this dead code.
2014-03-21 22:29:24 +01:00
Zdenek Kabelac
73978f8d7d clvmd: drop unused local_sock parameter 2014-03-21 22:29:24 +01:00
Zdenek Kabelac
37396e2fe5 clvmd: update add_reply_to_list
Take mutex lock after the allocation just before
the structure is merged into reply list.
2014-03-21 22:29:24 +01:00
Zdenek Kabelac
2847994624 clvmd: use dm_malloc
Use libdm malloc wrapper functions.
2014-03-21 22:29:24 +01:00
Zdenek Kabelac
c45cd6eb8d clvmd: move call of cluster_closedown
We have to close cluster in some predicatable way,
otherwise we may access released memory from different
threads.

So move closedown till the point we know all thread
are closed. New messages from cluster are discarded.
2014-03-21 22:29:23 +01:00
Zdenek Kabelac
fc39ad677b clvmd: move destroy_lvm into lvm thread
Since lvm was initialized in lvm thread call destroy there as well.
2014-03-21 22:29:23 +01:00
Zdenek Kabelac
8431d47b3b clvmd: add special lvm thread exit
When multiple threads act on the same 'quit' variable
the order of exit becomes unpredictable.

So let the main_loop() finish first and then clean up
all queued lvm jobs.

Do not add any new work, when lvm_thread_exit is set.
2014-03-21 22:29:23 +01:00
Zdenek Kabelac
05a532e171 clvmd: always set cleanup_needed
When thread is created, set the cleanup_needed flag
immediately so it could be used properly any time later
when cleanup_zombie() is needed.
2014-03-21 22:29:23 +01:00
Zdenek Kabelac
5bea2b5c82 clvmd: fix clean memory on exit
Properly clean 'client' structure only for LOCAL_SOCK type.
(Fixes bug from commit 460c19df62)
(in release fix)

Also cleanup-up associated pthreads by using cleanup_zombie() function.
Since this function may change the list, restart scanning always from
the list header.

Note: couple following patches are necessary to make this working properly.
2014-03-21 22:29:22 +01:00
Zdenek Kabelac
486b15d36c memlock: drop locked mem in critical section
When daemon releases memory and it is still in critical
section, issue an error message and drop memory.

We cannot do anything better for now and we at least
release allocated resource.

FIXME:

This code is triggered when i.e. clvmd is killed while
some LVs are suspend - in this case suspended devices leak,
so if this happens during i.e. clvmd upgrade we have
unresolved problem - even locked rootfs...
2014-03-21 22:29:22 +01:00
Zdenek Kabelac
0ca16c6946 activate: report release with critical section
This function is typically called for cmd context refresh or destroy.
On the non-clustered case we already unlocked all messages,
however when i.e. 'clvmd' gets break signal it may have
still couple messages queued.

For now just report an error.
2014-03-21 22:29:22 +01:00
Zdenek Kabelac
e5382c063d lvmcache: fix debug trace
Recent debug tracing commit introduce read of uninitialized memory,
since VGID is not really a proper string which ends with '\0'.
Enforce at most 32 (ID_LEN) chars are read from vgid.
(in release fix)
2014-03-21 22:29:22 +01:00
Zdenek Kabelac
fc280bcc42 lvmcache: handle reinit without error
Since commit f12ee43f2e call destroy,
it start to check all VGs are unlocked. However when we become_daemon,
we simply reset locking (since lock is still kept by parent process).
So implement a simple 'reset' flag.
2014-03-21 22:29:21 +01:00
Jonathan Brassow
bdd7baeab3 cmirrord: Clean-up stray warning message (attempt #2)
There are two types of CPG communications in a corosync cluster:
messages and state transitions.  Cmirrord processes the state
transitions first.

When a cluster mirror issues a POSTSUSPEND, it signals the end of
cluster communication with the rest of the nodes in the cluster.
The POSTSUSPEND marks the last communication of the 'message'
type that will go around the cluster.  The node then calls
cpg_leave which causes a final 'state transition' communication to
all of the nodes.  Once the out-going node receives its own state
transition notice from the cluster, it finalizes the leave.  At this
point, the state of the log is 'INVALID'; but it is possible that
there remains some cluster trafic that was queued up behind the
state transition that still wants to be processed.  It is harmless
to attempt to dispatch any remaining messages - they won't be
delivered because the node is no longer in the cluster.  However,
there was a warning message that was being printed in this case
that is now removed by this patch.  The failure of the dispatch
created a false positive condition that triggered the message.
2014-03-19 14:43:00 -05:00
Petr Rockai
f12ee43f2e polldaemon: Re-initialise lvmcache properly on fork (fixes RHBZ 1073670). 2014-03-19 16:25:12 +01:00
Peter Rajnoha
2f279797f5 WHATS_NEW: commit 5eef269 2014-03-19 09:49:09 +01:00
Peter Rajnoha
000e81a999 cleanup: add cmd_context reference to struct cft_check_handle
So we have all things needed to do a configuration check packaged
in one handle. It makes function calls inside a bit more readable.
2014-03-19 08:45:05 +01:00
Zdenek Kabelac
b6eb2ac10a cleanup: indent 2014-03-19 00:58:02 +01:00
Zdenek Kabelac
852a2b98be pvscan: cleanup updates
Simplify code:
 remove unneeded assignments
 use unsigned values for length
2014-03-19 00:58:02 +01:00
Zdenek Kabelac
3d7eaf9226 pvscan: fix report of long pv names
pvscan --uuid was broken since it was using only 128 char buffers
without checking any write size, so any longer device path leads to
crash.

Also ansure format is properly aligned into columns with this option.
2014-03-19 00:58:01 +01:00
Zdenek Kabelac
caf93eb1cb cleanup: simplify pv name print
pv_vg_name() now already hides orphans.
2014-03-19 00:58:01 +01:00
Zdenek Kabelac
506091be70 pv_vg_name: do not expose internal orphans to lvm2 users
Check for orphan VG name and return just empty string,
Use internally pv->vg_name if the real orphan name is needed.
2014-03-19 00:57:59 +01:00
Thomas Fehr
5b69bfb6f8 pvdisplay: fix man to refer to sectors, not KB
The PV size is displayed in sectors, not kilobytes
for 'pvdisplay -c'

Signed-off-by: Thomas Fehr <fehr@suse.de>
Acked-by: Hannes Reinecke <hare@suse.de>
2014-03-19 00:49:32 +01:00
Zdenek Kabelac
52525bde04 pvdisplay: use log_print_unless_silent for info messages 2014-03-19 00:48:39 +01:00
Zdenek Kabelac
013f5f4550 metadata: print VG with invalid chars in quotes
We we report invalid chars, put quotes around vg name.
2014-03-19 00:48:39 +01:00
Zdenek Kabelac
6a8d3d7811 clvmd: avoid resending local sync commands
Instead of sending repeatedly  LOCAL_SYNC commands to clvmds
like 'lvs', rememeber the last sent commmand, and if there was no other
clvmd command, drop this redundant SYNC call message.

The problem has started with commit:
56cab8cc03

This introduced correct synchronisation of name, when user requests to know
open_count (needs to wait for udev), however it is also executed for
read-only cases like 'lvs' command.

For now implement very simple solution, which is only monitoring
outgoing clvmd command, and when sequence of LOCAL sync names are
recognized, they are skipped automatically.

TODO:
Future solution might move this variable info 'cmd_context' and
use  'needs_sync' flag also i.e. in file locking code.
2014-03-19 00:47:58 +01:00
Zdenek Kabelac
a6b159e99c file_locking: use PATH_MAX for dir name
Using just 128 chars for locking dir may wail if longer
dir entry is used, swich to default linux max path.
2014-03-19 00:46:28 +01:00
Zdenek Kabelac
08018a5345 archiver: drop unneeded backup check
When the backup is disabled, avoid testing backup presence.
This only leads to errors being logged in debug trace and the missing
backup can't be fixed, since it's disabled.
2014-03-19 00:45:41 +01:00
Peter Rajnoha
25f5e2da8d dumpconfig: fix memleak when using --mergedconfig
Check whether lvm dumpconfig --mergedconfig is used only
with --type current (where we're merging current config and
the config supplied on command line). With other types
the config was merged, but it was thrown away since we're
generating other type of config anyway. This lead to a memleak.

Error out if --mergedconfig is used with anything else than
--type current (or without specifying --type in which case
the --type current is used by default).
2014-03-18 11:11:31 +01:00
Zdenek Kabelac
aed36c12f8 tests: use check lv_tree_on
Use internal /lib function.
Reduce extent size for test to create smaller devices.
2014-03-18 10:28:09 +01:00
Zdenek Kabelac
81166a84be tests: more fedora kernels unusable for testing raid456 2014-03-18 10:28:08 +01:00