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

16608 Commits

Author SHA1 Message Date
Zdenek Kabelac
219fe72359 hints: validate sscanf results 2019-11-14 18:06:42 +01:00
Zdenek Kabelac
d4d82dbb70 hints: allocate hint only when needed
Avoid mem leaking hint on every loop continue and
allocate hint only when it's going to be added into list.

Switch to use 'dm_strncpy()' and validate sizes.
2019-11-14 18:06:42 +01:00
Zdenek Kabelac
70fb31b5d6 hints: rewrite function 2019-11-14 18:06:42 +01:00
Zdenek Kabelac
1f4968289c pvck: check result of dev_get_size
Don't use garbage value for later computations.
2019-11-14 18:06:42 +01:00
Zdenek Kabelac
d67ce9e140 cov: fix mem leaking buffer
Free allocated buffer on function's exit.
Also check for fwrite() results.
2019-11-14 18:06:42 +01:00
Zdenek Kabelac
0bad3977df cov: avoid passing NULL to strstr function
When 'str1' would be NULL, there is no point to run 2nd. strstr().
2019-11-14 18:06:42 +01:00
Zdenek Kabelac
153e55c20e cov: check for retvalue 2019-11-14 18:06:42 +01:00
Zdenek Kabelac
44bf9c9a6a cov: fix memleak for duplicate device
For  dev_in_device_list() != 0 allocated  'devl' was
actually leaking - so instead allocate 'devl' only
when !dev_in_device_list() and indent code around.
2019-11-14 18:06:42 +01:00
Zdenek Kabelac
82e6b820b8 cov: check for NULL
Since we check for NULL pointers earlier we need
to be consistent across function - since the NULL
would applies across whole function.

When dropping 'mda' check - we are actually
already dereferencing it before - so it can't
be NULL at that places (and it's validated
before entering  _read_mda_header_and_metadata).
2019-11-14 18:06:42 +01:00
Zdenek Kabelac
43f149526d devtype: simplify code
Update code with simpler form and check for fclose().
2019-11-14 18:06:14 +01:00
Zdenek Kabelac
33c8e4de33 cov: fix memory leak
Reapply 23cc7ddc50 to internal version
of libdm.
2019-11-14 18:05:41 +01:00
Heming Zhao
13c254fc05 fix dev_unset_last_byte after write error
dev_unset_last_byte() must be called while the fd is still valid.
After a write error, dev_unset_last_byte() must be called before
closing the dev and resetting the fd.

In the write error path, dev_unset_last_byte() was being called
after label_scan_invalidate() which meant that it would not unset
the last_byte values.

After a write error, dev_unset_last_byte() is now called in
dev_write_bytes() before label_scan_invalidate(), instead of by
the caller of dev_write_bytes().

In the common case of a successful write, the sequence is still:
dev_set_last_byte(); dev_write_bytes(); dev_unset_last_byte();

Signed-off-by: Zhao Heming <heming.zhao@suse.com>
2019-11-13 09:36:58 -06:00
Zdenek Kabelac
9cad26be32 WHATS_NEW: update 2019-11-11 22:44:25 +01:00
Zdenek Kabelac
38617213f0 tests: add test of resize of different segtypes 2019-11-11 22:44:25 +01:00
Zdenek Kabelac
08f36dd093 lvextend: fix resizing volumes of different segtype
When resizing 2 volumes like  thin-pool and it's metadata and they
would be of a different type - command would be actually expecting
both LVs being of a same segtype - and would throw an error in
case they are different.

This patch fixes is by setting a new segtype from last segment of
2nd. extented device.

Also it fixes the possible 'percentage' extension setup that
might have been used for 'primary' volume - while the 'secondary'
LV always goes with direct size - as we do not support 'percentage'
setup for them

This affects maily usage of thin-pool where the extension of
thin-pool data size may also lead to extension of metadata size.
2019-11-11 22:44:25 +01:00
Zdenek Kabelac
3b05fd4d07 tests: add extra settle
To avoid removing, while 'add' might not have been processed yet.
(when emulating reboot in pvmove-restart)
2019-11-11 22:44:25 +01:00
Zdenek Kabelac
ba313ac84a tests: skip unneeded status check
If 'remove' was succesful - we can break loop immediatelly.
2019-11-11 22:44:25 +01:00
Zdenek Kabelac
1cc1333599 daemons: check for non-zero thread_id
Do not call pthread_join if thread_id would be 0.
2019-11-11 22:44:25 +01:00
Zdenek Kabelac
cc865749ae daemon: better error path handling for shutdown
Report errors for open in better order.
Ensure descriptors are not leaked.
2019-11-11 22:44:25 +01:00
Zdenek Kabelac
43db8f8d5d cov: ensure read_ahead is available
Make sure read_ahead pointer is not NULL when quering for RA.
2019-11-11 22:44:25 +01:00
Zdenek Kabelac
30a23a1941 cov: missing checks of syscalls
Check for sigprocmask errors
2019-11-11 22:44:25 +01:00
Zdenek Kabelac
8679d45917 gcc: avoid declaration shadowing
dev_name is global in device.h
2019-11-11 22:44:18 +01:00
Heinz Mauelshagen
e184f77109 man: adjust 'disks' to 'devices' as used throughout 2019-11-07 17:45:37 +01:00
Marian Csontos
8263e62b00 test: Fix metadata-zero-space with long VG names 2019-11-06 16:20:27 +01:00
Zdenek Kabelac
c67a03727b tests: be happy with less then 90 percent
Thin metadata evolve between kernel version, so it's not always
precisely predictible its usage - so let's met test happy,
when it gets bellow 90%.
2019-11-01 16:31:12 +01:00
Zdenek Kabelac
dbaa4cdcdf tests: skip test if scsi_debug is not available 2019-11-01 16:31:12 +01:00
Zdenek Kabelac
5f064e2221 tests: slowdown delay of raid
Slowdown 'delay' more.
2019-11-01 16:31:12 +01:00
Zdenek Kabelac
c935f8a327 tests: conversion only of exclusive lv
We can 'cache' only exclusively active LV in cluster.
2019-11-01 16:27:21 +01:00
Zdenek Kabelac
d1c5b3ae74 tests: avoid checking command result in cluster
When running cluster test with clvmd, the actual 'monitoring'
happens in cluster - so the 'already monitored' message
is also logged within clvmd code and the command cannot
see such effect.

clvmd was incapable to report this information back to command
so it cannot be displayed this way.

Add 'lvs -o+seg_monitor' validation which also works in clustered mode.
2019-11-01 16:27:21 +01:00
Zdenek Kabelac
569e328cc0 WHATS_NEW: update 2019-10-31 15:43:02 +01:00
Zdenek Kabelac
cca5aec0ef activation: drop removed declaration
Seems this function has been removed long time ago with:
3e781ea446
2019-10-31 15:33:09 +01:00
Zdenek Kabelac
50b50039d9 tests: reduce space requirements
Test well runs on smaller test machines.
2019-10-31 15:31:30 +01:00
Zdenek Kabelac
8689b4ed82 raid: drop internal error
Fix some internal error reports and debug trace returns
2019-10-31 15:31:30 +01:00
Zdenek Kabelac
3d9fc7d6f3 manip: optimize lvs_using_lv
Instead of checking all LVs in a VG - do just a direct copy of LVs
from the existing list ->segs_using_thin_lv.

TODO: maybe it could be better to expose seg_list to /tools...
2019-10-31 15:31:30 +01:00
Zdenek Kabelac
c21440536d mirror: remove unused code 2019-10-31 15:31:30 +01:00
Zdenek Kabelac
ab315e7a81 mirror: directly activate updated mirror 2019-10-31 15:31:30 +01:00
Zdenek Kabelac
80b2de9e6a mirror: fix leg splitting
Enhance lv_info with lv_info_with_name_check.
This 'variant' not only check existance if UUID in DM table
but also compares its  DM name  whether it's matching expected LV name.
Otherwise activation may 'skip' activation with rename in case the
DM UUID already exists, just device is different name.

This change make fairly easier manipulation with i.e. detached mirror
leg which ATM is using same UUID - just the LV name have been changed.

Used code was not able to run 'activation' (and do a rename) and just
skipped the call. So the code used to do a workaround and 'tried'
to deactivate such LV firts - this however work only in non-clvmd case,
as cluster was not having the lock for deactivated LV.

With this extended lv_info code will run 'activation' and will
synchronize the name to match expected LV name.

Patch extends _lv_info() with new paramter 'with_name_check',
which is later translated into 'name_check' argument for
_info_run() which in case of name mismatch evaluates the
check as if device does not exists.

Such call is only used in one place _lv_activate() which then
let activation run.  All other invocation of _info() calls
are left intact.

TODO: fix mirror table manipulation (and raid)....
2019-10-31 15:31:30 +01:00
Tony Asleson
8b3cf53e24 Experimental VDO lvmdbusd support 2019-10-30 10:55:06 -05:00
Tony Asleson
508d1808b0 lvmdbustest.py: Use local data instead of fetching
Avoid making more dbus calls to get information we already have.  This
also avoids us getting an error where a dbus object representation is
being deleted by another process while we are trying to gather information
about it across the wire.
2019-10-30 10:38:40 -05:00
Tony Asleson
f91df163e2 lvmdbustest.py: Improve concurrent test handling
Filter out LVs too, so that we can run more than 1 instance of the
unit test at the same time.
2019-10-30 10:38:40 -05:00
Tony Asleson
f961311436 lvmdbustest.py: Add tests for LV interface
Add tests for all the different LV types with the standard LV dbus
interface.  These tests shook out a couple of new bugs.
2019-10-30 10:38:40 -05:00
Tony Asleson
1bbf977577 lvmdbusd: Debug msg. improvements. 2019-10-30 10:38:40 -05:00
Tony Asleson
4dcb36aba4 lvmdbusd: Fix model inconsistency when LV loses interface
When a LV loses an interface it ends up getting removed and recreated.
This happens after the VGs have been processed and updated.  Thus when
this happens we need to re-check the VGs.
2019-10-30 10:38:40 -05:00
Tony Asleson
f56b21ae2c lvmdbusd: Bug fix for activate/deactivate
Prevent the daemon from stalling when it gets stuck on a y/n prompt.
2019-10-30 10:38:40 -05:00
Tony Asleson
9e15c83673 testlib.py: Add interface instance vars. 2019-10-30 10:38:40 -05:00
Tony Asleson
b7aab9ba59 testlib.py: WS corrections 2019-10-30 10:38:40 -05:00
Tony Asleson
89373761c8 lvmdbustest.py: Add basic vdo test 2019-10-30 10:38:40 -05:00
Tony Asleson
ed7e365ae5 testlib.py: Correct dbus signature verification
This allows us to fully verify introspection data matches what we are
getting.
2019-10-30 10:38:40 -05:00
Tony Asleson
5971da2c72 lvmdbusd: VDO Pool LV representation
VDO pool LVs are represented by a new dbus interface VgVdo.  Currently
the interface only has additional VDO properties, but when the
ability to support additional LV creation is added we can add a method
to the interface.
2019-10-30 10:38:40 -05:00
Tony Asleson
455498f206 lvmdbustest.py: Create common func. _create_cache_lv 2019-10-30 10:38:40 -05:00