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

14592 Commits

Author SHA1 Message Date
Zdenek Kabelac
94838b4df0 lvmcmdline: validate size as double
Since we are reading size as (double) we can get way bigger
number then just plain int64. So to make this check actually
more valid and usable do a maxsize compare in 'double'.
2017-07-17 12:32:18 +02:00
Zdenek Kabelac
28e319ddc0 clvmd: fix valgrind memory report
Avoid reading already released memory and do a continue directly.

Invalid read of size 1
   at 0x1201B0: main_loop (clvmd.c:931)
   by 0x11F640: main (clvmd.c:666)
 Address 0x72ddef0 is 32 bytes inside a block of size 224 free'd
   at 0x4C30D18: free (vg_replace_malloc.c:530)
   by 0x54D6FD1: dm_free_wrapper (dbg_malloc.c:357)
   by 0x122E6E: process_work_item (clvmd.c:2034)
   by 0x123003: lvm_thread_fn (clvmd.c:2085)
   by 0x590A3A8: start_thread (pthread_create.c:465)
   by 0x5C3C7FE: clone (in /usr/lib64/libc-2.25.90.so)
 Block was alloc'd at
   at 0x4C2FB6B: malloc (vg_replace_malloc.c:299)
   by 0x54D6EF1: dm_malloc_aux (dbg_malloc.c:286)
   by 0x54D6F1C: dm_zalloc_aux (dbg_malloc.c:291)
   by 0x54D6F96: dm_zalloc_wrapper (dbg_malloc.c:345)
   by 0x11F89C: local_rendezvous_callback (clvmd.c:731)
   by 0x1203D2: main_loop (clvmd.c:964)
   by 0x11F640: main (clvmd.c:666)
2017-07-17 12:30:01 +02:00
Zdenek Kabelac
d7f92ea8ee clvmd: fix valgrind warning
Initialize mutex upfront any debugging and fix this report:

Mutex reinitialization: mutex 0x485d20, recursion count 0, owner 1.
   at 0x4C38480: pthread_mutex_init_intercept (drd_pthread_intercepts.c:821)
   by 0x4C38480: pthread_mutex_init (drd_pthread_intercepts.c:830)
   by 0x11F359: main (clvmd.c:562)
mutex 0x485d20 was first observed at:
   at 0x4C38F63: pthread_mutex_lock_intercept (drd_pthread_intercepts.c:885)
   by 0x4C38F63: pthread_mutex_lock (drd_pthread_intercepts.c:898)
   by 0x11E920: debuglog (clvmd.c:254)
   by 0x11F1D8: main (clvmd.c:527)
2017-07-17 12:29:57 +02:00
Zdenek Kabelac
ea96a9d68e devcache: correct logging severity for connection
Switch from warn to log_error since this generated
failing return code for command so printing log_error()
is mandatory.

Happens with i.e. pvscan --cache meets crashing lvmetad.
2017-07-17 12:28:51 +02:00
Zdenek Kabelac
919fa89482 lvmetad: fix memory leaks
Hash tables need to release no longer needed inserted data.
2017-07-17 12:27:53 +02:00
Heinz Mauelshagen
fb641c3423 raid: add validation checks for segment data_offset member
Commit 34504855a7 introduced
flag LV_RESHAPE_DATA_OFFSET and used it to avoid incompatible
activation on older runtime.

Enhance vg_validate() raid checking functions with checks for it.
2017-07-15 00:51:43 +02:00
Zdenek Kabelac
c64e2a85cb tests: use get_devs 2017-07-15 00:13:33 +02:00
Zdenek Kabelac
413209f3f8 tests: utils.sh looks for more dumps
Check for core in  sysctl kernel.core_pattern
(assuming core prefix still)
2017-07-15 00:12:07 +02:00
Zdenek Kabelac
2154f30a99 tests: add udev_wait before tearing scsi_debug
Make less probably there will be some udev work going while we try
to remove scsi_debug target.
2017-07-14 20:30:04 +02:00
Zdenek Kabelac
ac0945bc4a tests: aux.sh fix double quote
Patch 72a58ce4b0 was wronly placing
double quotes around this variable which we want to pass expanded,
as it's just set of 'space' device args ATM.

TODO consider using array[@] to make this cleaner.
Add shellcheck directive to skip warning here
2017-07-14 20:29:38 +02:00
Marian Csontos
1c95cf8c6f tests: utils.sh six stacktrace
Changes:

- BASH_SOURCE index was one off.
- The first line of stacktrace was pure confusion displaying executed
  script together with innermost line number (which was either 125 when
  STACKTRACE or 229 when skip was called.)
- We can safely ignore innermost call, as stack trace is always produced
  by stacktrace function.
- It is safer to test for array length, instead of testing FUNCNAME is
  main - if main function were introduced.
- Bashishm is safe to use as this function as a whole is relying on bash.
2017-07-14 20:18:42 +02:00
Heinz Mauelshagen
34504855a7 raid: add data_offset incompatibility segment type flag
In order to reject out of place reshaping with segment data_offset
field on old runtime, add a respective segment type incompatibility
flag causing "+RESHAPE_DATA_OFFSET" to be suffixed to the segment
type name.
2017-07-14 15:53:23 +02:00
Heinz Mauelshagen
1d69fc7c5e raid: use return_0 for better backtracking 2017-07-14 15:53:23 +02:00
Heinz Mauelshagen
1c4b7a3c2d report: fix data_offset/new_data_offset reporting 2017-07-14 15:53:23 +02:00
Heinz Mauelshagen
6685460f5a lvconvert: allow reshaping in the cluster and on open devices
The previous commit fixed allocation/activation of reshape space.

Remove conditionals prohibiting reshaping in these cases.

Related: rhbz1447812
Related: rhbz1448116
Related: rhbz1461562
2017-07-14 15:53:23 +02:00
Heinz Mauelshagen
f1b78665ef raid: fix allocation/activation of reshape space
When reshape space is allocated anew, an update and reload is needed to
promote the new size to the cluster node with the exclusively active RaidLV
or reloading the RaidLV will fail with a size related error.  Additionally,
store "data_offset <sectors>" with the RaidLV in the lvm2 metadata so that
it can be retrieved on cluster nodes.

Process allocation of reshape space on a 2-legged raid4/5 (interim layout
to convert from/to linear via raid1) properly in the cluster.

Resolves: rhbz1461562
Resolves: rhbz1448116
2017-07-14 15:53:23 +02:00
Zdenek Kabelac
cd4e6c9b17 tests: aux.sh integrate both teardown loops
Use 1 logic for 2 loops tearing down left device.
First loops tries to remove all closed devices with 'normal' remove.
Second loop tries to replace those left devices with 'error' target.
2017-07-14 13:22:15 +02:00
Zdenek Kabelac
8a2448a4ed tests: skip test for non dirty cache
Seems some cache LV can't be made dirty easily with older
cache policy implementations....
2017-07-14 00:42:40 +02:00
Zdenek Kabelac
e682af7878 tests: aux.sh better teardown loop
We can't really sleep that much in teardown as it slows test too much.
So do a nested loop (similar to 'dmsetup remove_all') and keep
removing devices with open count == 0 as long as it works.
2017-07-14 00:27:55 +02:00
Zdenek Kabelac
f64f6c5e70 tests: wait for udev to minize race windows
mkfs can complain about volume in use when meets udev rule processing.
2017-07-13 21:11:16 +02:00
Zdenek Kabelac
870c7bc76c tests: bound variables 2017-07-13 21:11:16 +02:00
Zdenek Kabelac
e88534b680 tests: delay read of cache pool data
It's better to delay read of cached data.
Limit loop checking for cleaner policy.
2017-07-13 21:11:16 +02:00
Zdenek Kabelac
490e6e9ef1 tests: add some delay after dmsetup
When we want to squash as much device as possible,
it's better to give it some delay, so devices have
some time to release it's resouces for next removal.

Also drop surrounding cookie processing and let each
dmsetup call run on its own.
2017-07-13 21:11:16 +02:00
Alasdair G Kergon
5027c3c7ee format_text: Extend FIXME to reduce label scans
It's unnecessarily scanning all invalid labels even when nothing changed
instead of first just scanning the ones under the lock.
2017-07-13 17:05:49 +01:00
Alasdair G Kergon
c2de4b9747 docs: Refresh kernel target docs 2017-07-12 18:59:52 +01:00
Zdenek Kabelac
c838e79cd2 tests: fix for new hardened bash
Add missing get_devs.
When $7 is not given use empty string.
See if we can live with less RAM disk for PVs.
Drop limitation on single core as presence 1.12 should address this.
2017-07-12 18:05:56 +02:00
David Teigland
e329da173f pvs: use dummy structs in duplicate processing
Use the same dummy struct approach from report.c
when a pv needs to be processed without a real vg.
2017-07-12 10:51:54 -05:00
Zdenek Kabelac
c4b6df94b4 tests: properly check variables were defined
When test suite is installed some vars are not defined.
2017-07-12 13:51:16 +02:00
Zdenek Kabelac
1daa1cc3a9 tests: use properly quoted device list 2017-07-12 13:50:25 +02:00
Zdenek Kabelac
5a91b0a2e2 tests: fix detection of running dmeventd after test
The checking order here has happend after TESTDIR was removed
resulting in weird further error on trap path.

Properly check for unexpected dmeventd before removing TESTDIR
since  'trap' codepath is still using it.

Also try to kill this unexpected dmeventd so testing is
not skipping all next  dmeventd tests.

(Downside would be - if user would be accidentally starting
dmeventd by some regular system admin work - such dmeventd
might be killd if it's unused. It can't kill dmeventd in-use.
2017-07-12 13:38:07 +02:00
Zdenek Kabelac
d9ef564e42 tests: utils.sh drop gdb_commands.txt
Remove file after use (fixes recursive STACKTRACE calls)
2017-07-12 01:50:06 +02:00
Zdenek Kabelac
0f2dccc601 tests: bounds still more vars 2017-07-12 01:37:29 +02:00
Zdenek Kabelac
ec9b845aaa tests: drop type
Assuming test wanted to check $lv3 does not exists.
2017-07-12 01:21:44 +02:00
Zdenek Kabelac
a1ed9bc145 tests: more exact test
Check there is really just linear.

Also short-circuit mimages_are_on_ when file is empty
(avoids unbound  mimages[@] access on older bash)
2017-07-12 01:21:44 +02:00
Zdenek Kabelac
8387f4efc9 tests: more vars bounded 2017-07-12 01:21:44 +02:00
Zdenek Kabelac
2baac408fc tests: aux.sh better loop logic
Instead of using pipe for read and haveing no chance
to modify shell vars inside such loop  use  <( )
and keep using bash arrays.
2017-07-12 01:21:44 +02:00
Zdenek Kabelac
b97f75b133 tests: improve logic for a race to catch abortion 2017-07-11 17:21:25 +02:00
Zdenek Kabelac
a87860965e tests: hardening - no unbound vars
Dissallow usage of any unbound shell variable in tests.
All vars needs to have some defined value.
2017-07-11 16:48:25 +02:00
Zdenek Kabelac
41e11e0f21 tests: check.sh simplify in_sync
Avoid calling sed.
2017-07-11 16:26:12 +02:00
Zdenek Kabelac
5ab2676bac tests: double quote 2017-07-11 16:26:12 +02:00
Zdenek Kabelac
21e0e98665 tests: correct typo
Use defined MARKED_AS_USED_MSG shell var.
2017-07-11 16:26:12 +02:00
Zdenek Kabelac
429e613ba8 tests: avoid unbound shell var usage 2017-07-11 16:26:12 +02:00
Zdenek Kabelac
f11e74ae3d tests: improve test logic
Use existing vars.
Reduce extra lvchange -an and use directly activation with lvcreate.
2017-07-11 16:26:12 +02:00
Zdenek Kabelac
2c3d9a07cb cleanup: whitespace 2017-07-11 16:26:12 +02:00
Alasdair G Kergon
3cd492cd59 commands: fix lvm shell segfaults
Don't check for -h/--help if argc is 1.
2017-07-11 01:42:06 +01:00
David Teigland
56768ce36b lvm: report error if options are set before command
Previously, strange parsing errors were reported.
2017-07-10 11:02:11 -05:00
David Teigland
442d60842d lvm: run help from -h|--help 2017-07-10 11:02:11 -05:00
Zdenek Kabelac
e9a544b942 tests: avoid using readarray
Real bashman can live without readarray.

Support older tested machines with bash <4.0....
2017-07-10 17:40:31 +02:00
Eric Ren
d71b738c17 man: specify slow device when creating origin LV
Also make the slow device name consistent everywhere.

Signed-off-by: Eric Ren <zren@suse.com>
2017-07-10 14:58:33 +02:00
Eric Ren
7617e08c03 cleanup: fix some typos
form -> from
accomodate -> accommodate

Signed-off-by: Eric Ren <zren@suse.com>
2017-07-10 14:58:33 +02:00