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

15664 Commits

Author SHA1 Message Date
David Teigland
559cf0cd1e devices: drop open error message
This open error is being printed in more common,
non-error circumstances than expected.  After a
number of complaints make it only a debug message.
2019-04-23 09:42:25 -05:00
Zdenek Kabelac
228e331e27 cleanup: missed string specifier 2019-04-17 11:29:35 +02:00
Zdenek Kabelac
3ead62e24b tests: check vgsplit works with cache 2019-04-16 12:57:18 +02:00
Zdenek Kabelac
fa025cdd9a cache: support vgsplit
Enable vgsplit to work with VG containing cached LVs.
2019-04-16 12:57:18 +02:00
Marian Csontos
f5d1f4f086 Wiping require exclusive actvation
The master branch uses activate_lv only, but on the stable branch
activate_lv_excl_local was used. This patch restores the constraints.

Fix regression from bad cherry pick: 9b04851fc5
2019-04-16 08:26:34 +02:00
Heinz Mauelshagen
699bf86090 lvconvert: can't create cachepool with RAID1 metadata SubLV
Trying to convert an exiting RAID1 LV to cache metadata SubLV
fails because of missing exclusive activation during wiping.

Solve by activating the RAID1 metadata SubLV exclusively.

Resolves: rhbz1698866
2019-04-12 21:38:04 +02:00
Peter Rajnoha
03d6cfdd99 systemd: put back DefaultDependencies=no for lvmpolld and lvmetad socket unit
Previous commit 0a726a7e26 removed this
by mistake - we have to keep the DefaultDependencies=no - the
sockets.target is after sysinit.target.
2019-04-11 12:25:45 +02:00
Zdenek Kabelac
6064b9f1b2 gcc: cleanup const warning 2019-04-10 13:30:34 +02:00
Zdenek Kabelac
6d4f36c2c7 libdaemon: use pselect to avoid condition checking race
To avoid tiny race on checking arrival of signal and entering select
(that can latter remain stuck as signal was already delivered) switch
to use  pselect().

If it would needed, we can eventually add extra code for older systems
without pselect(), but there are probably no such ancient systems in
use.
2019-04-10 13:28:45 +02:00
Zdenek Kabelac
63289b54c7 configure: check for pselect 2019-04-10 13:24:41 +02:00
Peter Rajnoha
0a726a7e26 systemd: add missing Before=shutdown.target to LVM2 services to fix shutdown ordering
We already used Conflicts=shutdown target to stop LVM2 services on shutdown.
But we still missed the ordering - the shutdown.target should be reached
only after all the services are really stopped.

Reported here: https://github.com/lvmteam/lvm2/issues/17
2019-04-09 12:40:55 +02:00
Marian Csontos
b79f1e176f bcache: Fix memory leak 2019-04-04 10:19:15 +02:00
Marian Csontos
81d954df4e post-release 2019-03-22 11:13:08 +01:00
Marian Csontos
7cbee7e9cf pre_release 2019-03-22 11:04:15 +01:00
Marian Csontos
717957ddc5 build: make generate 2019-03-22 11:01:04 +01:00
Heinz Mauelshagen
9b04851fc5 raid: fix (de)activation of RaidLVs with visible SubLVs
There's a small window during creation of a new RaidLV when
rmeta SubLVs are made visible to wipe them in order to prevent
erroneous discovery of stale RAID metadata.  In case a crash
prevents the SubLVs from being committed hidden after such
wiping, the RaidLV can still be activated with the SubLVs visible.
During deactivation though, a deadlock occurs because the visible
SubLVs are deactivated before the RaidLV.

The patch adds _check_raid_sublvs to the raid validation in merge.c,
an activation check to activate.c (paranoid, because the merge.c check
will prevent activation in case of visible SubLVs) and shares the
existing wiping function _clear_lvs in raid_manip.c moved to lv_manip.c
and renamed to activate_and_wipe_lvlist to remove code duplication.
Whilst on it, introduce activate_and_wipe_lv to share with
(lvconvert|lvchange).c.

Resolves: rhbz1633167
(cherry picked from commit dd5716ddf2)

Conflicts:
	WHATS_NEW
	lib/activate/activate.c
	lib/metadata/lv_manip.c
	lib/metadata/raid_manip.c
	tools/lvchange.c
	tools/lvconvert.c
2019-03-21 08:05:23 +01:00
David Teigland
dcf8f3111a pvscan: lvmetad init should set updating before scanning
When pvscan needs to initialize lvmetad (e.g. lvmetad has just
started and is empty), it should set the lvmetad state to "updating"
before it scans any devices.  Otherwise, many parallel pvscans
will try to initialize lvmetad, and in some cases earlier pvscans
with fewer devices information may replace newer pvscans with
more recent information.
2019-03-07 11:07:27 -06:00
David Teigland
ece0b131e5 config: improve scan_lvs description 2019-03-06 13:38:33 -06:00
Alasdair G Kergon
519f4453a5 dmsetup: Fix multi-line concise table parsing
Use the correct loop variable within the loop, instead of reusing the
initial value.  Table lines after the first don't get terminated in
the right place.

Signed-off-by: Kurt Garloff <kurt@garloff.de>
(cherry picked from commit ccfbd505fe)
2019-03-05 13:01:40 +01:00
Zdenek Kabelac
bc6ae7030a dm: migration_threshold for old linked tools
Just like with precending  lvm2 device_mapper patch, ensure
that old users of libdm will also get fixed migration threshold
for caches.

(cherry picked from commit 74ae1c5bc1)

Conflicts:
	WHATS_NEW_DM
2019-03-05 13:01:19 +01:00
Zdenek Kabelac
167aa34926 stats: initilize regions to NULL
Commit 3750b0cff5 used bad: error
path in more occasions thus it now needs regions defined as NULL.

(cherry picked from commit 83c6f7e7e6)
2019-03-05 12:57:50 +01:00
Zdenek Kabelac
8fc64c5ee6 stats: fix error path when region is NULL
We should not call _stats_cleanup_region_ids() when regions
are NULL.
Also add backtracing for  goto.

(cherry picked from commit 3750b0cff5)
2019-03-05 12:57:40 +01:00
Zdenek Kabelac
8d44cd3e47 libdm: add memory barrier
Just for case ensure compiler is not able to optimize
memset() away for resources that are released.

This idea of using memory barrier is taken from openssl.

Other options would be to check for 'explicit_bzero' function.

(cherry picked from commit 55a8d6c86b)

Conflicts:
	device_mapper/ioctl/libdm-iface.c
2019-03-05 12:48:15 +01:00
Zdenek Kabelac
40f57155a3 libdm: print params only for ioctls using them
When preparing ioctl buffer and flatting all parameters,
add table parameters only to ioctl that do process them.

Note: list of ioctl should be kept in sync with kernel code.
(cherry picked from commit 43f8da7699)

Conflicts:
	WHATS_NEW_DM
	device_mapper/ioctl/libdm-iface.c
2019-03-05 12:47:50 +01:00
Zdenek Kabelac
1bef4dfab3 libdm: add DM_DEVICE_ARM_POLL
Expose DM_DEVICE_ARM_POLL via standard API enum.

(cherry picked from commit 1ae5bf2b83)

Conflicts:
	WHATS_NEW_DM
	device_mapper/all.h
	device_mapper/ioctl/libdm-iface.c
2019-03-05 12:46:21 +01:00
Zdenek Kabelac
e974f6866a cleanup: move cast to det_t into MKDEV macro
(cherry picked from commit aa8b2d6a0f)

Conflicts:
	daemons/clvmd/clvmd-common.h
	device_mapper/ioctl/libdm-iface.c
	device_mapper/libdm-common.c
	device_mapper/libdm-deptree.c
2019-03-05 12:39:17 +01:00
Zdenek Kabelac
a93699ece9 cov: remove unused assigns
(cherry picked from commit 70e3d0a613)

Conflicts:
	tools/pvscan.c
	tools/vgchange.c
2019-03-05 12:28:31 +01:00
Zdenek Kabelac
e4bb94a93e cov: hide intentionaly ptr arithmetic report
Only single region count is ever replaced with on-stack uint64_t.

(cherry picked from commit a91ac41b93)
2019-03-05 12:17:18 +01:00
Zdenek Kabelac
93ac80037a cov: mark warning as expected one
(cherry picked from commit 9238b972c5)

Conflicts:
	base/data-struct/radix-tree-adaptive.c
	device_mapper/libdm-file.c
2019-03-05 12:16:33 +01:00
Zdenek Kabelac
c9e5e6800c cov: split check for type assignment
Check that type is always defined, if not make it explicit internal
error (although logged as debug - so catched only with proper lvm.conf
setting).
This ensures later type being NULL can't be dereferenced with coredump.

(cherry picked from commit 79879bd201)
2019-03-05 12:16:07 +01:00
Zdenek Kabelac
f0f68791f3 cov: shutdown warning
Since previous patch reverted coverity patch as this case is intentional,
provide override this coverity warning.

(cherry picked from commit 05b5774827)
2019-03-05 12:15:40 +01:00
Zdenek Kabelac
b39c26ddc3 revert "cov: dm stats missed terminating null"
This reverts commit 20971f7034
as the parsing of 'dmstatus' started to fail on present \0 char.

(cherry picked from commit 6179cab877)
2019-03-05 12:15:16 +01:00
Zdenek Kabelac
d1ae1455b4 cov: ensure vars are set
Make sure, tmp_begin and tmp_end are always set, even for blind
coverity.

(cherry picked from commit 2513661467)

Conflicts:
	device_mapper/libdm-report.c
2019-03-05 12:14:43 +01:00
Marian Csontos
c115d92287 cov: dmstats check for failing malloc
Add missing check for allocation success.

Backported from: 9b71212262
2019-03-05 12:13:08 +01:00
Zdenek Kabelac
ece117ee10 cov: dm stats missed terminating null
Coverity noticed allocating insufficient memory
for the terminating null of the string.

(cherry picked from commit 20971f7034)
2019-03-05 12:10:36 +01:00
David Teigland
590a1ebcf7 io: increase the default io memory from 4 to 8 MiB
This is the default bcache size that is created at the
start of the command.  It needs to be large enough to
hold a single copy of metadata for a given VG, or the
VG cannot be read or written (since the entire VG would
not fit into available memory.)

Increasing the default reduces the chances of anyone
needing to increase the default to use their VG.

The size can be set in lvm.conf global/io_memory_size;
the lower limit is 4 MiB and the upper limit is 128 MiB.
2019-03-04 11:18:34 -06:00
David Teigland
863a2e693e io: warn when metadata size approaches io memory size
When a single copy of metadata gets within 1MB of the
current io_memory_size value, begin printing a warning
that the io_memory_size should be increased.
2019-03-04 10:57:52 -06:00
David Teigland
8dbfdb5b73 config: add new setting io_memory_size
which defines the amount of memory that lvm will allocate
for bcache.  Increasing this setting is required if it is
smaller than a single copy of VG metadata.
2019-03-04 10:31:47 -06:00
Marcos Paulo de Souza
675b94a11b pvscan.service.in: Move StartLimitInterval to Service section
Without this patch, pvscan service file contains StartLimitInterval at
the Unit section, which trigger an error:

 Unknown lvalue 'StartLimitInterval' in section 'Unit'

Moving StartLimitInterval to Service section fixes the issue.

Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.de>
2019-02-28 09:38:34 -06:00
David Teigland
850e95f24a tests: add scan_lvs.sh 2019-02-20 14:38:01 -06:00
David Teigland
083f162e8e WHATS_NEW: scan_lvs 2019-02-20 14:33:09 -06:00
David Teigland
7f56908c2b tests: set scan_lvs=1 in tests that stack PVs on LVs 2019-02-20 14:32:01 -06:00
David Teigland
427e8ba3e3 config: change scan_lvs default to 0
so that lvm does not scan LVs for PVs by default.
2019-02-20 14:31:03 -06:00
David Teigland
6a5575e959 filter: add config setting to skip scanning LVs
devices/scan_lvs (default 1) determines whether lvm
will scan LVs for layered PVs.  The lvm behavior has
always been to scan LVs, but it's rare for LVs to have
layered PVs, and much more common for there to be many
LVs that substantially slow down scanning with no benefit.

This is implemented in the usable filter, and has the
same effect as listing all LVs in the global_filter.
2019-02-20 14:30:24 -06:00
David Teigland
57cde6063f apply obtain_device_list_from_udev to all libudev usage
udev_dev_is_md_component and udev_dev_is_mpath_component
are not used for obtaining the device list, but they still
use libudev for device info.  When there are problems with
udev, these functions can get stuck. So, use the existing
obtain_device_list_from_udev config setting to also control
whether these "is component" functions are used, which gives
us a way to avoid using libudev entirely when it's causing
problems.
2019-02-05 10:20:24 -06:00
David Teigland
d0cb672466 lvmlockd: fix make lockstart wait
when building without lvmlockd
2019-01-31 09:56:29 -06:00
David Teigland
75886f59e4 lvmlockd: make lockstart wait for existing start
If there are two independent scripts doing:
  vgchange --lockstart vg
  lvchange -ay vg/lv

The first vgchange to do the lockstart will wait for
the lockstart to complete before returning.
The second vgchange to do the lockstart will see that
the start is already in progress (from the first) and
will do nothing.  This means the second does not wait
for any lockstart to complete, and moves on to the
lvchange which may find the lockspace still starting
and fail.

To fix this, make the vgchange lockstart command
wait for any lockstart's in progress to complete.
2019-01-31 09:38:50 -06:00
Marian Csontos
1d2de5dd13 spec: Use python3 setuptools with python3 2019-01-03 14:39:28 +01:00
Ming-Hung Tsai
df0797db8c lvmanip: uninitialized members in struct pv_list (#10)
Scenario: Given an existed LV `lvol0`, I want to create another LV
on the PVs used by `lvol0`.

I use `build_parallel_areas_from_lv()` to obtain the `pv_list` of each segments.
However, the returned `pv_list` is not properly initialized, which causes
segfault in subsequent operations.

(cherry picked from commit 859feb81e5)
(cherry picked from commit 219ba4f54a)

Conflicts:
	WHATS_NEW
2018-12-19 09:18:25 +01:00
Marian Csontos
2d077286b9 post-release 2018-12-07 15:19:10 +01:00