]> sourceware.org Git - lvm2.git/log
lvm2.git
7 years agotests: get.sh declare and assign separately
Zdenek Kabelac [Thu, 29 Jun 2017 08:26:28 +0000 (10:26 +0200)]
tests: get.sh declare and assign separately

Declare and assign separately to avoid masking return values.

Also comment-out currently unused  orig variable.

7 years agotests: get.sh double quote
Zdenek Kabelac [Thu, 29 Jun 2017 08:27:56 +0000 (10:27 +0200)]
tests: get.sh double quote

7 years agotests: utils.sh separately assign
Zdenek Kabelac [Thu, 29 Jun 2017 19:22:52 +0000 (21:22 +0200)]
tests: utils.sh separately assign

Declare and assign separately to avoid masking return values.

7 years agotests: utils.sh avoid iterating over ls output
Zdenek Kabelac [Thu, 29 Jun 2017 19:22:23 +0000 (21:22 +0200)]
tests: utils.sh avoid iterating over ls output

7 years agotests: utils.sh arithmetic
Zdenek Kabelac [Thu, 29 Jun 2017 08:19:32 +0000 (10:19 +0200)]
tests: utils.sh arithmetic

expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].
$ is unnecessary on arithmetic variables.

7 years agotests: utils.sh no mixed string array
Zdenek Kabelac [Thu, 29 Jun 2017 08:14:59 +0000 (10:14 +0200)]
tests: utils.sh no mixed string array

Argument mixes string and array. Use * or separate argument.

7 years agotests: utils.sh double quote
Zdenek Kabelac [Thu, 29 Jun 2017 08:12:21 +0000 (10:12 +0200)]
tests: utils.sh double quote

7 years agotests: lvm-wrapper.sh legacy syntax
Zdenek Kabelac [Thu, 29 Jun 2017 08:02:36 +0000 (10:02 +0200)]
tests: lvm-wrapper.sh legacy syntax

7 years agotests: lvm-wrapper.sh double quote
Zdenek Kabelac [Thu, 29 Jun 2017 08:01:49 +0000 (10:01 +0200)]
tests: lvm-wrapper.sh double quote

7 years agotests: inittest.sh double quote and mixing string
Zdenek Kabelac [Thu, 29 Jun 2017 08:38:06 +0000 (10:38 +0200)]
tests: inittest.sh  double quote and mixing string

7 years agotests: check.sh eliminate useless cat
Zdenek Kabelac [Thu, 29 Jun 2017 09:56:47 +0000 (11:56 +0200)]
tests: check.sh eliminate useless cat

Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.

7 years agotests: check.sh better if
Zdenek Kabelac [Thu, 29 Jun 2017 07:40:01 +0000 (09:40 +0200)]
tests: check.sh better if

Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.

7 years agotests: check.sh drop unnecessary $
Zdenek Kabelac [Thu, 29 Jun 2017 07:37:20 +0000 (09:37 +0200)]
tests: check.sh drop unnecessary $

$/${} is unnecessary on arithmetic variables.

7 years agotests: check.sh using grep -F
Zdenek Kabelac [Thu, 29 Jun 2017 06:41:43 +0000 (08:41 +0200)]
tests: check.sh using grep -F

fgrep is non-standard and deprecated. Use grep -F instead.

7 years agotests: check.sh no mixing string
Zdenek Kabelac [Thu, 29 Jun 2017 06:40:55 +0000 (08:40 +0200)]
tests: check.sh no mixing string

Argument mixes string and array. Use * or separate argument.

7 years agotests: check.sh assign separately
Zdenek Kabelac [Thu, 29 Jun 2017 06:39:21 +0000 (08:39 +0200)]
tests: check.sh assign separately

Declare and assign separately to avoid masking return values.

7 years agotests: check.sh double quote
Zdenek Kabelac [Thu, 29 Jun 2017 06:23:23 +0000 (08:23 +0200)]
tests: check.sh double quote

7 years agotests: aux.sh fix pid handling
Zdenek Kabelac [Thu, 29 Jun 2017 19:00:17 +0000 (21:00 +0200)]
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.

7 years agotests: aux.sh add -r to read
Zdenek Kabelac [Thu, 29 Jun 2017 18:50:06 +0000 (20:50 +0200)]
tests: aux.sh add -r to read

7 years agotests: aux.sh array assing
Zdenek Kabelac [Thu, 29 Jun 2017 18:45:46 +0000 (20:45 +0200)]
tests: aux.sh array assing

Assigning an array to a string! Assign as array, or use * instead of @ to concatenate.

7 years agotests: aux.sh separately assign
Zdenek Kabelac [Thu, 29 Jun 2017 10:07:34 +0000 (12:07 +0200)]
tests: aux.sh separately assign

Declare and assign separately to avoid masking return values.

7 years agotests: aux.sh using grep -c
Zdenek Kabelac [Thu, 29 Jun 2017 05:59:11 +0000 (07:59 +0200)]
tests: aux.sh using grep -c

Consider using grep -c instead of grep|wc -l.

7 years agotests: aux.sh no mixing string
Zdenek Kabelac [Thu, 29 Jun 2017 05:57:59 +0000 (07:57 +0200)]
tests: aux.sh no mixing string

Argument mixes string and array. Use * or separate argument.

7 years agotests: aux.sh drop unnecessary $
Zdenek Kabelac [Wed, 28 Jun 2017 22:17:59 +0000 (00:17 +0200)]
tests: aux.sh drop unnecessary $

$/${} is unnecessary on arithmetic variables.

7 years agotests: aux.sh use pgrep
Zdenek Kabelac [Wed, 28 Jun 2017 22:04:47 +0000 (00:04 +0200)]
tests: aux.sh use pgrep

7 years agotests: aux.sh double quote
Zdenek Kabelac [Wed, 28 Jun 2017 22:02:19 +0000 (00:02 +0200)]
tests: aux.sh double quote

7 years agoclvmd_fix_conf.sh: double quote
Zdenek Kabelac [Thu, 29 Jun 2017 20:07:49 +0000 (22:07 +0200)]
clvmd_fix_conf.sh: double quote

7 years agoclvmd_fix_conf.sh: legacy code
Zdenek Kabelac [Thu, 29 Jun 2017 20:03:00 +0000 (22:03 +0200)]
clvmd_fix_conf.sh: legacy code

Use $(..) instead of legacy `..`.

7 years agovgimportclone.sh: do not quote regex
Zdenek Kabelac [Thu, 29 Jun 2017 16:54:26 +0000 (18:54 +0200)]
vgimportclone.sh: do not quote regex

Don't quote rhs of =~, it'll match literally rather than as a regex.

7 years agovgimportclone.sh: use well defined tests
Zdenek Kabelac [Wed, 28 Jun 2017 18:35:34 +0000 (20:35 +0200)]
vgimportclone.sh: use well defined tests

Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.

7 years agovgimportclone.sh: drop extra $
Zdenek Kabelac [Wed, 28 Jun 2017 18:31:09 +0000 (20:31 +0200)]
vgimportclone.sh: drop extra $

$/${} is unnecessary on arithmetic variables.

7 years agovgimportclone.sh: add -r to read
Zdenek Kabelac [Wed, 28 Jun 2017 18:26:23 +0000 (20:26 +0200)]
vgimportclone.sh: add -r to read

read without -r will mangle backslashes.

7 years agovgimportclone.sh: avoid legacy syntax
Zdenek Kabelac [Wed, 28 Jun 2017 18:20:15 +0000 (20:20 +0200)]
vgimportclone.sh: avoid legacy syntax

Use $(..) instead of legacy `..`.

7 years agovgimportclone.sh: cannot trap signal 9
Zdenek Kabelac [Wed, 28 Jun 2017 18:06:59 +0000 (20:06 +0200)]
vgimportclone.sh: cannot trap signal 9

7 years agovgimportclone.sh: double quote
Zdenek Kabelac [Wed, 28 Jun 2017 18:05:42 +0000 (20:05 +0200)]
vgimportclone.sh: double quote

7 years agovgimportclone.sh: no mixing string and array
Zdenek Kabelac [Wed, 28 Jun 2017 17:40:34 +0000 (19:40 +0200)]
vgimportclone.sh: no mixing string and array

Argument mixes string and array. Use * or separate argument.

7 years agolvm2_cluster_activation_red_hat.sh: double quote
Zdenek Kabelac [Thu, 29 Jun 2017 20:12:23 +0000 (22:12 +0200)]
lvm2_cluster_activation_red_hat.sh: double quote

7 years agolvmconf_lockingtype2: double quote
Zdenek Kabelac [Wed, 28 Jun 2017 19:13:52 +0000 (21:13 +0200)]
lvmconf_lockingtype2: double quote

7 years agolvmconf_lockingtype2: preferable syntax
Zdenek Kabelac [Wed, 28 Jun 2017 19:09:52 +0000 (21:09 +0200)]
lvmconf_lockingtype2: preferable syntax

Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.

7 years agolvmdump: replace individual redirects
Zdenek Kabelac [Thu, 29 Jun 2017 14:21:19 +0000 (16:21 +0200)]
lvmdump: replace individual redirects

Consider using { cmd1; cmd2; } >> file instead of individual redirects.

7 years agolvmdump: drop useless cat
Zdenek Kabelac [Wed, 28 Jun 2017 19:02:23 +0000 (21:02 +0200)]
lvmdump: drop useless cat

Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.

7 years agolvmdump: legacy syntax
Zdenek Kabelac [Wed, 28 Jun 2017 19:00:48 +0000 (21:00 +0200)]
lvmdump: legacy syntax

Use $(..) instead of legacy `..`.

7 years agolvmdump: drop extra $
Zdenek Kabelac [Wed, 28 Jun 2017 18:56:17 +0000 (20:56 +0200)]
lvmdump: drop extra $

$/${} is unnecessary on arithmetic variables.

7 years agolvmdump: replace printf
Zdenek Kabelac [Wed, 28 Jun 2017 18:54:00 +0000 (20:54 +0200)]
lvmdump: replace printf

Don't use variables in the printf format string. Use printf "..%s.." "$foo".
Advice replaced with plain 'echo'.

7 years agolvmdump: double quote
Zdenek Kabelac [Wed, 28 Jun 2017 18:48:19 +0000 (20:48 +0200)]
lvmdump: double quote

Double quote to prevent globbing and word splitting.

7 years agolvmconf: prefer well defined and
Zdenek Kabelac [Wed, 28 Jun 2017 17:25:41 +0000 (19:25 +0200)]
lvmconf: prefer well defined and

Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.

7 years agolvmconf: double quote
Zdenek Kabelac [Wed, 28 Jun 2017 15:22:08 +0000 (17:22 +0200)]
lvmconf: double quote

7 years agolvmconf: fix test for setting external locking type
Zdenek Kabelac [Wed, 28 Jun 2017 15:22:22 +0000 (17:22 +0200)]
lvmconf: fix test for setting external locking type

Fix test for check of set locking lib dir.

7 years agoblkdeactivate: quote literal
Zdenek Kabelac [Thu, 29 Jun 2017 16:47:28 +0000 (18:47 +0200)]
blkdeactivate: quote literal

This { is literal. Check expression (missing ;/\n?) or quote it.

7 years agoblkdeactivate: more readable if-then-else-fi
Zdenek Kabelac [Wed, 28 Jun 2017 14:55:38 +0000 (16:55 +0200)]
blkdeactivate: more readable if-then-else-fi

7 years agoblkdeactivate: split local declaration and assign
Zdenek Kabelac [Wed, 28 Jun 2017 14:50:34 +0000 (16:50 +0200)]
blkdeactivate: split local declaration and assign

7 years agoblkdeactivate: drop unused var
Zdenek Kabelac [Wed, 28 Jun 2017 17:36:49 +0000 (19:36 +0200)]
blkdeactivate: drop unused var

7 years agoblkdeactivate: double quote
Zdenek Kabelac [Wed, 28 Jun 2017 14:33:00 +0000 (16:33 +0200)]
blkdeactivate: double quote

Using double quote to prevent globbing and word splitting.

7 years agoblkdeactivate: replace obsoleted syntax
Zdenek Kabelac [Wed, 28 Jun 2017 14:15:36 +0000 (16:15 +0200)]
blkdeactivate: replace obsoleted syntax

7 years agofsadm: make if statement more clear
Zdenek Kabelac [Wed, 28 Jun 2017 14:13:29 +0000 (16:13 +0200)]
fsadm: make if statement more clear

7 years agofsadm: add -r to read
Zdenek Kabelac [Wed, 28 Jun 2017 14:07:33 +0000 (16:07 +0200)]
fsadm: add -r to read

read without -r will mangle backslashes

7 years agofsadm: no mixing string and array
Zdenek Kabelac [Thu, 29 Jun 2017 14:01:42 +0000 (16:01 +0200)]
fsadm: no mixing string and array

Argument mixes string and array. Use * or separate argument.

7 years agofsadm: split local var dev
Zdenek Kabelac [Wed, 28 Jun 2017 14:02:13 +0000 (16:02 +0200)]
fsadm: split local var dev

Split defining of local variables from being them
assigned at the same time (lossing error code).

7 years agofsadm: remove surrounding $()
Zdenek Kabelac [Thu, 29 Jun 2017 14:04:19 +0000 (16:04 +0200)]
fsadm: remove surrounding $()

Remove surrounding $() to avoid executing output

7 years agofsadm: fix shell globbing
Zdenek Kabelac [Thu, 29 Jun 2017 11:15:47 +0000 (13:15 +0200)]
fsadm: fix shell globbing

Fixing reported issue for shellcheck.
Use "" properly to avoid having shell variables split.

7 years agopost-release
Alasdair G Kergon [Wed, 28 Jun 2017 16:00:49 +0000 (17:00 +0100)]
post-release

7 years agopre-release v2_02_172
Alasdair G Kergon [Wed, 28 Jun 2017 15:38:46 +0000 (16:38 +0100)]
pre-release

7 years agocommand: we don't have all standard macros
Zdenek Kabelac [Wed, 28 Jun 2017 13:05:16 +0000 (15:05 +0200)]
command: we don't have all standard macros

So just quite warning

7 years agocoverity: checked_return of close
Zdenek Kabelac [Wed, 28 Jun 2017 12:40:35 +0000 (14:40 +0200)]
coverity: checked_return of close

Check (or make quiet) close() ret code.
NOTE: there is another duplicated code of daemonize function which
should be converted to libdaemon.

7 years agoman: regenerate
Alasdair G Kergon [Tue, 27 Jun 2017 14:47:00 +0000 (15:47 +0100)]
man: regenerate

7 years agolog: fix message prefix truncation
Alasdair G Kergon [Tue, 27 Jun 2017 11:41:59 +0000 (12:41 +0100)]
log: fix message prefix truncation

Restore the 29-character prefix limit that commit
e907535ab977ea29319aeb015cec6c06729f7ce4 ("coverity: use better
function") accidentally reduced to 28 characters.

7 years agocoverity: model few more functions
Zdenek Kabelac [Tue, 27 Jun 2017 07:23:22 +0000 (09:23 +0200)]
coverity: model few more functions

Reduce amount of FP.

7 years agocoverity: move initilization of count variable
Zdenek Kabelac [Tue, 27 Jun 2017 10:05:27 +0000 (12:05 +0200)]
coverity: move initilization of count variable

Make code more understandble for Coverity, so it sees connection
between 'extents' and 'count' and in fact code is more readable.

7 years agocoverity: drop unneeded assigns
Zdenek Kabelac [Tue, 27 Jun 2017 09:38:56 +0000 (11:38 +0200)]
coverity: drop unneeded assigns

7 years agocoverity: validate length of renaming path
Zdenek Kabelac [Tue, 27 Jun 2017 09:37:24 +0000 (11:37 +0200)]
coverity: validate length of renaming path

Make sure path fits into buffer on stack.

7 years agocoverity: check malloc results
Zdenek Kabelac [Tue, 27 Jun 2017 08:18:00 +0000 (10:18 +0200)]
coverity: check malloc results

7 years agocoverity: use better function
Zdenek Kabelac [Tue, 27 Jun 2017 08:17:33 +0000 (10:17 +0200)]
coverity: use better function

7 years agocoverity: extra check for find_pool_seg
Zdenek Kabelac [Tue, 27 Jun 2017 08:16:13 +0000 (10:16 +0200)]
coverity: extra check for find_pool_seg

find_pool_seg may return NULL in some internal error stats.
Handle it explicitely.

7 years agodebug: more display_lvname usage
Zdenek Kabelac [Tue, 27 Jun 2017 06:28:36 +0000 (08:28 +0200)]
debug: more display_lvname usage

7 years agocoverity: validate retval from get_only_segment_using_this_lv
Zdenek Kabelac [Mon, 26 Jun 2017 22:24:34 +0000 (00:24 +0200)]
coverity: validate retval from get_only_segment_using_this_lv

7 years agocoverity: add some error path for failed allocs
Zdenek Kabelac [Mon, 26 Jun 2017 21:57:12 +0000 (23:57 +0200)]
coverity: add some error path for failed allocs

Coverity reports some unchecked allocations.

7 years agodebug: use display_lvname
Zdenek Kabelac [Mon, 26 Jun 2017 21:58:06 +0000 (23:58 +0200)]
debug: use display_lvname

7 years agodebug: fix error path
Zdenek Kabelac [Mon, 26 Jun 2017 21:32:04 +0000 (23:32 +0200)]
debug: fix error path

Coverity:
log_error may have dereference NULL pointer - use directly
segtype string name.

7 years agodebug: fail in backup is not traced nor error
Zdenek Kabelac [Mon, 26 Jun 2017 21:27:10 +0000 (23:27 +0200)]
debug: fail in backup is not traced nor error

7 years agodebug: tracing error path
Zdenek Kabelac [Mon, 26 Jun 2017 21:21:22 +0000 (23:21 +0200)]
debug: tracing error path

7 years agodebug: check for fail in id validation
Zdenek Kabelac [Mon, 26 Jun 2017 21:20:29 +0000 (23:20 +0200)]
debug: check for fail in id validation

7 years agocleanup: remove unused code
Zdenek Kabelac [Mon, 26 Jun 2017 21:19:57 +0000 (23:19 +0200)]
cleanup: remove unused code

7 years agodev_manager: add missing validation for usable target_name
Zdenek Kabelac [Mon, 26 Jun 2017 21:34:38 +0000 (23:34 +0200)]
dev_manager: add missing validation for usable target_name

Coverity shown path where target_name == NULL would be dereferenced.

7 years agoraid: fix write_commit_backup
Zdenek Kabelac [Mon, 26 Jun 2017 21:25:24 +0000 (23:25 +0200)]
raid: fix write_commit_backup

With commit 41c10034aa0db3c63f18ff78b64af3a799c154a1 we actually
do require LV to be used with _vg_write_lv_suspend_commit_backup().

So write a proper separte single wrapper for write && commit && backup.

7 years agocmdline: fix missing NULL at end of array of args
Zdenek Kabelac [Mon, 26 Jun 2017 18:03:05 +0000 (20:03 +0200)]
cmdline: fix missing NULL at end of array of args

lvm_run needs to place NULL as the last element into argv[].
Otherwise we get:

Conditional jump or move depends on uninitialised value(s)
 _command_required_pos_matches (lvmcmdline.c:1443)
 _find_command (lvmcmdline.c:1610)
 lvm_run_command (lvmcmdline.c:2770)
 lvm2_run (lvmcmdlib.c:91)

7 years agolibdm: fix initialization of head for reused structure
Zdenek Kabelac [Mon, 26 Jun 2017 16:22:40 +0000 (18:22 +0200)]
libdm: fix initialization of head for reused structure

Dmeventd reuses  'dm_task' struct for some STATUS operation, but due to
missing reinitization of dm_task target list, it has caused misprocesing
of recieved events as the parsed target has been simply added to the
list of existing status and cause multiple actions being called for
single event.

7 years agotests: show more debug info
Zdenek Kabelac [Sat, 24 Jun 2017 21:01:26 +0000 (23:01 +0200)]
tests: show more debug info

Helpful for analysis (revert later).

7 years agotests: slightly longer delay
Zdenek Kabelac [Sat, 24 Jun 2017 20:58:08 +0000 (22:58 +0200)]
tests: slightly longer delay

Try to avoid race with slightly longer delay.

7 years agoraid: allow more sync action for extraction
Zdenek Kabelac [Sat, 24 Jun 2017 20:28:25 +0000 (22:28 +0200)]
raid: allow more sync action for extraction

Since we discovered status reporting from 'md' goes from large set
of weird states we can't just decided based on this word.
So let it pass for rebuild and idle as well
and check for health devices afterwards.

7 years agotests: correct percent values are reported
Zdenek Kabelac [Sat, 24 Jun 2017 15:24:38 +0000 (17:24 +0200)]
tests: correct percent values are reported

7 years agotests: unit test for percent printing
Zdenek Kabelac [Sat, 24 Jun 2017 11:33:36 +0000 (13:33 +0200)]
tests: unit test for percent printing

7 years agocleanup: use display_percent
Zdenek Kabelac [Sat, 24 Jun 2017 14:22:36 +0000 (16:22 +0200)]
cleanup: use display_percent

Replace occurence of %.2f with call of display_percent function.

7 years agodisplay: add display_percent function
Zdenek Kabelac [Sat, 24 Jun 2017 14:03:21 +0000 (16:03 +0200)]
display: add display_percent function

Add universal function to print dm_percent_t values via single
code path.

TODO: extend with configurale precision of printed values.

7 years agolibdm: use rounded float for percent print
Zdenek Kabelac [Sat, 24 Jun 2017 14:39:50 +0000 (16:39 +0200)]
libdm: use rounded float for percent print

Use new added  dm_percent_to_round_float to enhance print
of percentage values.

7 years agolibdm: implement dm_percent_to_round_float
Zdenek Kabelac [Sat, 24 Jun 2017 11:24:26 +0000 (13:24 +0200)]
libdm: implement dm_percent_to_round_float

Add function to adjust printing of percent values in better way.
Rounding here is going along following rules:

0% & 100% are always clearly reported with  .0 decimal points.

Values slightly above 0% we make sure a nearest bigger
non zero value with given precission is printed
(i.e. 0.01  for  %.2f  will be shown)

For values closely approaching 100% we again detect and adjust value
that is less then 100 when printed.
(i.e. 99.99  for %.2f will be shown).

For other values we are leaving them with standard rounding mechanism
since we care mainly about corner values 0 & 100 which need to be
printed precisely.

7 years agodmeventd: improve more raid status reporting
Zdenek Kabelac [Fri, 23 Jun 2017 22:06:12 +0000 (00:06 +0200)]
dmeventd: improve more raid status reporting

When we want to report primary leg failure, check for intial 'a',
since otherwice 'Aa idle' is normally visible.

Also reset array of bit flags marking dead devices, once
plugin detects raid is in sync.

7 years agotests: use allocate policy in raid test
Zdenek Kabelac [Fri, 23 Jun 2017 21:22:34 +0000 (23:22 +0200)]
tests: use allocate policy in raid test

7 years agotests: add transient failure test
Zdenek Kabelac [Fri, 23 Jun 2017 21:20:01 +0000 (23:20 +0200)]
tests: add transient failure test

Check raid  repairs still 'present', but failed device.

TODO: tests needs more checking about repair actually doing its work.

7 years agotests: require also no 'a' for in-sync
Zdenek Kabelac [Fri, 23 Jun 2017 19:14:29 +0000 (21:14 +0200)]
tests: require also no 'a' for in-sync

Raid easily reports  'idle' with 'a', so in this case
we will not report in-sync.

7 years agoraid: plugin does not to use --config
Zdenek Kabelac [Fri, 23 Jun 2017 19:15:37 +0000 (21:15 +0200)]
raid: plugin does not to use --config

Functionality of ignore suspend devices is already granted by:

lvm2_disable_dmeventd_monitoring() -> init_run_by_dmeventd() ->
init_ignore_suspended_devices().

In fact plugins should never use --config because it has
some unpleasant technical issues.

This page took 0.070802 seconds and 5 git commands to generate.