1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
Commit Graph

14746 Commits

Author SHA1 Message Date
Zdenek Kabelac
32c0dc3549 tests: aux.sh double quote 2017-07-10 14:23:53 +02:00
Zdenek Kabelac
84e83ac37e tests: aux.sh replace sed call
Use internal shell vars manips
2017-07-10 14:23:53 +02:00
Zdenek Kabelac
928a49a7c8 tests: aux.sh use grep -E
egrep is nonstandard.
2017-07-10 14:23:53 +02:00
Zdenek Kabelac
5bd09cb79d tests: aux.sh drop useless echo
Simply trim on space.
2017-07-10 14:23:53 +02:00
Zdenek Kabelac
6be61bf044 tests: aux.sh check cd result
Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
2017-07-10 14:23:53 +02:00
Zdenek Kabelac
c87e1afa03 tests: export many shell vars with 1 command 2017-07-10 14:23:53 +02:00
Peter Rajnoha
c48149cf80 udev: also create /dev/disk/by-part{label,uuid} and gpt-auto-root symlinks
The blkid we call in 13-dm-disk.rules also returns identifiers for
partitions based on which the /dev/disk/by-part{uuid,label} and
gpt-auto-root symlinks should be created in the same manner as we
already create symlinks for filesystem labels and uuids.

This is because we handle blkid calls and symlink creation under
/dev/disk ourselves in our 13-dm-disk.rules for device-mapper devices
for us to have more control over this process.

See also https://lists.freedesktop.org/archives/systemd-devel/2017-July/039220.html
and original report http://tracker.ceph.com/issues/19489 for
the exact case where these symlinks were missing.
2017-07-10 12:36:39 +02:00
David Teigland
cf3a6bbbe8 commands: fix handing of ENO_SUCH_CMD in script
Fix the error messages when an unrecognized command is
run from a script.  We shouldn't attempt to parse options
for an unrecognized command name, which causes misleading
errors about bad options, but rather exit right when we
know the command name is not valid.  Also don't complain
about exiting without an error message when running a
script if no command didn't exist.
2017-07-07 15:34:27 -05:00
David Teigland
85f1814e9d commands: centralize shell vs script vs command decision
This clarifies the point where lvm decides if it is
running an lvm shell, command or a script.
2017-07-07 15:33:44 -05:00
David Teigland
c995e40b63 lvmlockd: use DM_UUID_LEN for buffer size 2017-07-07 15:00:15 -05:00
Huan Zhang
bffae6c985 lvmlockd: miss adopt orphaned resources
1. dm_uuid is 68 byte length, but buf is 64 which
   will cause miss match uuid from lv lock manager
2. no lv lock_type path in dm config, use lock_args instead

Signed-off-by: Zhang Huan <zhanghuan@chinac.com>
2017-07-07 14:58:14 -05:00
David Teigland
3797f47ecf lvmlockd: fix revert in lvcreate
If the activation step in lvcreate fails (e.g. the specified
minor number is already used), then the lvcreate is reverted,
but the LV lock in lvmlockd was not being unlocked or properly
freed.
2017-07-07 14:42:25 -05:00
David Teigland
a0f6135e5c lvmlockd: use lock on thin pool when command names tdata
Some lvconvert commands can be used directly on the data sublv:
lvconvert ... vg/pool_tdata

The correct LV lock to use in lvmlockd is the one on the pool LV.
2017-07-07 12:06:53 -05:00
Alasdair G Kergon
fdd00ecdd1 lvmetad: Suppress accept error on clean shutdown
Also fix error message after pthread_create() error in handle_connect().
2017-07-06 14:53:10 +01:00
Heinz Mauelshagen
70c340dbc2 test: return 0 if ignoring 'a' device health chars is requested
This allows lvconvert-raid-reshape-striped_to_linear.sh to succeed when
it reduces raid5 to two stripes before converting to raid1 and linear.
2017-07-04 19:34:10 +02:00
Alasdair G Kergon
f2eda36cfa clvmd: Fix client list corruption
Centralise editing of the client list into _add_client() and
_del_client().  Introduce _local_client_count to track the size of the
list for debugging purposes.  Simplify and standardise the various ways
the list gets walked.

While processing one element of the list in main_loop(),
cleanup_zombie() may be called and remove a different element, so make
sure main_loop() refreshes its list state on return.  Prior to this
patch, the list edits for clients disappearing could race against the
list edits for new clients connecting and corrupt the list and cause a
variety of segfaults.

An easy way to trigger such failures was by repeatedly running shell
commands such as:
  lvs &; lvs &; lvs &;...;killall -9 lvs; lvs &; lvs &;...

Situations that occasionally lead to the failures can be spotted by
looking for 'EOF' with 'inprogress=1' in the clvmd debug logs.
2017-07-01 01:34:38 +01:00
Alasdair G Kergon
af789fd6d0 clvmd: add client id to debug log messages
Use standard format to make it easier to find the client to which each
debug log message refers.
2017-07-01 01:17:40 +01:00
Alasdair G Kergon
17ed254091 clvmd: add debuglog mutex
Log messages issued by different threads occasionally got intertwined.
2017-07-01 00:58:39 +01:00
Zdenek Kabelac
006a9eaada tests: aux.sh fix pattern
Commit 72a58ce4b0 fixed 'translation' of
pattern by bash by using "" - so we need to drop '\' here to get
wanted behavior.
2017-06-30 21:13:07 +02:00
Zdenek Kabelac
2ceb5a0abb coverity: just make impossible division by zero
Visible for analyzer  code will not try to use 0 for division.
2017-06-30 20:39:23 +02:00
Zdenek Kabelac
3d08b0971f man_generator: release buffer after use
Although ATM this code has no memory management at all,
it will not make any harm to release some memory,
when it's not needed anymore.
2017-06-30 20:39:02 +02:00
Zdenek Kabelac
ad286a3227 raid: ensure enum is defined
Just making sure enum is always defined.

TODO: code path using this enum needs closer inspection.
2017-06-30 20:39:02 +02:00
Zdenek Kabelac
c31614eccc tests: aux.sh use subshell for simple redirection 2017-06-30 17:08:47 +02:00
Zdenek Kabelac
57779e39ec tests: correcting globbing usage
Ensure globbing uses current dir.
Break loop when no match is found.
Let STACKTRACE finish its output when gdb fails.
2017-06-30 14:40:50 +02:00
Zdenek Kabelac
9348ad4f16 tests: aux prepares lvmdbusd
Correctly skip the test when lvmdbusd is found already running.
For pgrep usage we need to add '-f -l' options to get python3 name
printed.
Remove no longer used 'pids' local var.
2017-06-30 12:12:16 +02:00
Zdenek Kabelac
674a93ffe3 tests: aux do not specify bitmap for raid0 2017-06-30 12:09:10 +02:00
Zdenek Kabelac
596cf2c6fa tests: check LV in proper VG 2017-06-30 12:09:10 +02:00
Zdenek Kabelac
e84a145cf4 tests: check.sh uses array for list
For properly quoted args, switch to use arrays for arg list.
2017-06-30 12:09:10 +02:00
Zdenek Kabelac
c613fa48ff tests: api updates 2017-06-29 22:23:17 +02:00
Zdenek Kabelac
3d90c7fffc tests: get.sh declare and assign separately
Declare and assign separately to avoid masking return values.

Also comment-out currently unused  orig variable.
2017-06-29 22:23:17 +02:00
Zdenek Kabelac
834b82b0cd tests: get.sh double quote 2017-06-29 22:23:17 +02:00
Zdenek Kabelac
d7b3815223 tests: utils.sh separately assign
Declare and assign separately to avoid masking return values.
2017-06-29 22:23:17 +02:00
Zdenek Kabelac
cf4b671acd tests: utils.sh avoid iterating over ls output 2017-06-29 22:23:17 +02:00
Zdenek Kabelac
4697937af4 tests: utils.sh arithmetic
expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].
$ is unnecessary on arithmetic variables.
2017-06-29 22:23:17 +02:00
Zdenek Kabelac
00957450eb tests: utils.sh no mixed string array
Argument mixes string and array. Use * or separate argument.
2017-06-29 22:23:17 +02:00
Zdenek Kabelac
c396053955 tests: utils.sh double quote 2017-06-29 22:23:17 +02:00
Zdenek Kabelac
b442861f50 tests: lvm-wrapper.sh legacy syntax 2017-06-29 22:23:17 +02:00
Zdenek Kabelac
b1f80512c8 tests: lvm-wrapper.sh double quote 2017-06-29 22:23:17 +02:00
Zdenek Kabelac
32be18959d tests: inittest.sh double quote and mixing string 2017-06-29 22:23:17 +02:00
Zdenek Kabelac
b45ca523ec tests: check.sh eliminate useless cat
Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.
2017-06-29 22:23:17 +02:00
Zdenek Kabelac
51237cb504 tests: check.sh better if
Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
2017-06-29 22:23:17 +02:00
Zdenek Kabelac
db338c2b42 tests: check.sh drop unnecessary $
$/${} is unnecessary on arithmetic variables.
2017-06-29 22:23:17 +02:00
Zdenek Kabelac
c0197040a5 tests: check.sh using grep -F
fgrep is non-standard and deprecated. Use grep -F instead.
2017-06-29 22:23:17 +02:00
Zdenek Kabelac
824db54128 tests: check.sh no mixing string
Argument mixes string and array. Use * or separate argument.
2017-06-29 22:23:17 +02:00
Zdenek Kabelac
810f856c24 tests: check.sh assign separately
Declare and assign separately to avoid masking return values.
2017-06-29 22:23:17 +02:00
Zdenek Kabelac
02729202f3 tests: check.sh double quote 2017-06-29 22:23:17 +02:00
Zdenek Kabelac
491fcd2a92 tests: aux.sh fix pid handling
Modification of pids is local (to subshell caused by pipeline).
pids was modified in a subshell. That change might be lost.
2017-06-29 22:23:17 +02:00
Zdenek Kabelac
96fcf82ddd tests: aux.sh add -r to read 2017-06-29 22:23:17 +02:00
Zdenek Kabelac
ec02307e95 tests: aux.sh array assing
Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.
2017-06-29 22:23:17 +02:00
Zdenek Kabelac
8a912d6dbc tests: aux.sh separately assign
Declare and assign separately to avoid masking return values.
2017-06-29 22:23:17 +02:00