1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-25 01:34:38 +03:00
Commit Graph

4127 Commits

Author SHA1 Message Date
Zdenek Kabelac
a8921be641 monitoring: fix monitoring change for cluster
Fix bug in table reload for clustered VG.
Function used in lv/vgchange --monitor y|n is using 'somewhat' hackish
shortcut and accesses activation function monitor_dev_for_events()
directly rather through full device refresh to avoid table reload
in case user want to only change monitoring state of device.
However since with old 'mirrors' there is table change dropping
handle_error there was in some cases needed table update.

This was put into monitor_dev_for_events() with assumption
vg_write_lock_held() could be used to decide if the actual monitoring
change comes from read-only lock-holding commands lvchange/vgchange.
However the clustered locking part (clvmd) actually doesn't differentiate
about this concept of having VG openned in read-only or write mode.
So it caused unwanted reloads of mirror tables even in commands like lvconvert.

Thus for clustered locking there is full table reload put into the code and
shortcut applies only for non-clustered locking.

Also the patch tries to avoid calling repeated LV refresh in case the
lv/vgchange uses  --refresh & --monitor.
2019-05-06 15:57:52 +02:00
Zdenek Kabelac
e79e092f8b lv_manip: better work with PERCENT_VG modifier
When using 'lvcreate -l100%VG' and there is big disproportion between
real available space and requested setting - automatically fallback
to 100%FREE.

Difference can be seen when VG is big and already most space was
allocated, so the requestion 100%VG can end (and by spec for % modifier
it's correct) as LV with size of 1%VG.  Usually this is not a big
problem - buit in some cases - like cache-pool allocation, this
can result a big difference for chunksize selection.

With this patch it's more closely match common-sense logic without
the need of reitteration of too big changes in lvm2 core ATM.

TODO: in the future there should be allocator solving all allocations
in a single call.
2019-04-30 12:24:53 +02:00
Zdenek Kabelac
2047d405af activation: synchronize before removing devices
Udev is running udev-rule action upon 'resume'.

However lvm2 in special case is doing replacement of
'soon-to-be-removed' device with 'error' target for resuming
and then follows actual removal - the sequence is usually quick,
so when udev start action - it can result in 'strange' error
message in kernel log like:

Process '/usr/sbin/dmsetup info -j 253 -m 17 -c --nameprefixes --noheadings --rows -o name,uuid,suspended' failed with exit code 1.

To avoid this - we need to ensure there is synchronization wait for udev
between 'resume'  and 'remove' part of this process.

However existing code put strict requirement to avoid synchronizing with
udev inside critical section - but this originally came from requirement
to not do anything special while there could be devices in
suspend-state. Now we are able to see differnce between critical section
with or without suspended devices.  For udev synchronization only
suspended devices are prohibited to be there - so slightly relax
condition and allow calling and using 'fs_sync()' even inside critical
section - but there must not be any suspended device.
2019-04-30 12:07:42 +02:00
Zdenek Kabelac
f38cfd09c4 thin: fix maintenance of _pmspare
When metadata grows lvm2 may need to extend also _pmspare volume.
2019-04-30 12:02:49 +02:00
Zdenek Kabelac
515867bbad thin: resize metadata with data
When data are growing, adapt also size of metadata.
As we get way too many reports from users doing huge growths of
data portion while keep metadata small and avoiding using monitoring.

So to enhance the user-experience in case user requests grown of
thin-pool (without passing PV list for growth) - lvm2 will automaticaly
grown also the metadata part of thin-pool (if possible).
2019-04-30 12:02:49 +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
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
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
81d954df4e post-release 2019-03-22 11:13:08 +01:00
Marian Csontos
7cbee7e9cf pre_release 2019-03-22 11:04:15 +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
083f162e8e WHATS_NEW: scan_lvs 2019-02-20 14:33:09 -06: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
Marian Csontos
f5ea02ffee pre-release 2018-12-07 15:12:34 +01:00
David Teigland
fe1cabfa34 WHATS_NEW: sync io 2018-11-20 09:04:37 -06:00
David Teigland
9fda169077 update WHATS_NEW 2018-11-06 16:41:43 -06:00
Marian Csontos
fa8d5e4e81 post-release 2018-10-30 10:01:01 +01:00
Marian Csontos
b93aded021 pre-release 2018-10-30 10:00:58 +01:00
Marian Csontos
efa281685a Update WHATS_NEW 2018-10-30 10:00:24 +01:00
Heinz Mauelshagen
c26bde42af lvconvert: fix interim segtype regression on raid6 conversions
When converting from striped/raid0/raid0_meta
to raid6 with > 2 stripes, allow possible
direct conversion (to raid6_n_6).

In case of 2 stripes, first convert to raid5_n to restripe
to at least 3 data stripes (the raid6 minimum in lvm2) in
a second conversion before finally converting to raid6_n_6.

As before, raid6_n_6 then can be converted
to any other raid6 layout.

Enhance lvconvert-raid-takeover.sh to test the
2 stripes conversions to raid6.

Resolves: rhbz1624038
(cherry picked from commit e2e30a64ab)

Conflicts:
	WHATS_NEW
2018-09-10 11:21:02 +02:00
Peter Rajnoha
3374a59250 scripts: add After=rbdmap.service to {lvm2-activation-net,blk-availability}.service
We need to have Ceph RBD devices mapped first before use in a stack
where LVM is on top so make sure rbdmap.service is called before
generated lvm2-activation-net.service.

On shutdown, we need to stop blk-availability first before we stop the
rbdmap.service.

Resolves: rhbz1623479
(cherry picked from commit cb17ef221b)

Conflicts:
	WHATS_NEW
2018-09-05 14:41:55 +02:00
Marian Csontos
a1a89a453f Update WHATS_NEW 2018-08-28 15:31:55 +02:00
David Teigland
ed749cdb5b WHATS_NEW: recent fixes 2018-08-27 14:41:29 -05:00
David Teigland
a991664dec bcache: reduce MAX_IO to 256
This is the number of concurrent async io requests that
the scan layer will submit to the bcache layer.  There
will be an open fd for each of these, so it is best to
keep this well below the default limit for max open files
(1024), otherwise lvm may get EMFILE from open(2) when
there are around 1024 devices to scan on the system.
2018-08-24 14:50:53 -05:00
Heinz Mauelshagen
d910f75d89 lvconvert: fix conversion attempts to linear
"lvconvert --type linear RaidLV" on striped and raid4/5/6/10
have to provide the convenient interim layouts.  Fix involves
a cleanup to the convenience type function.

As a result of testing, add missing sync waits to
lvconvert-raid-reshape-linear_to_raid6-single-type.sh.

Resolves: rhbz1447809
(cherry picked from commit e83c4f07ca)

Conflicts:
	WHATS_NEW
2018-08-23 11:29:16 +02:00
Heinz Mauelshagen
acf40f5587 lvconvert: fix regression preventing direct striped conversion
Conversion to striped from raid0/raid0_meta is directly possible.

Fix a regression setting superfluous interim raid5_n conversion type
introduced by commit bd7cdd0b09.

Add new test script lvconvert-raid0-striped.sh.

Resolves: rhbz1608067
(cherry picked from commit 4578411633)

Conflicts:
	WHATS_NEW
2018-08-21 18:13:51 +02:00
Zdenek Kabelac
672b8c196b mirror: fix splitmirrors for mirror type
With improved mirror activation code --splitmirror issue poppedup
since there was missing proper preload code and deactivation
for splitted mirror leg.
2018-08-07 18:04:39 +02:00
Zdenek Kabelac
cc96eea029 cache: drop metadata_format validation
Allow to use any combination of cache metadata format for policy.
2018-08-07 18:04:14 +02:00
Marian Csontos
acd2c6f256 post-release 2018-08-02 08:08:34 +02:00
Marian Csontos
b10b462fde pre-release 2018-08-01 17:30:40 +02:00
Marian Csontos
0569add94c pre-release 2018-08-01 16:47:09 +02:00
Marian Csontos
ad10d42671 WHATS_NEW 2018-07-31 17:41:31 +02:00
Heinz Mauelshagen
50a603de6f lvconvert: reject conversions on raid1 split trackchanges LVs
Prohibit, because the tracking can't continue and
further conversions may fail with bogus error messages.

Resolves: rhbz1579072
(cherry picked from commit a004bb07f1)

Conflicts:
	WHATS_NEW
2018-07-26 14:02:20 +02:00
Heinz Mauelshagen
e4fe0d1b8f lvconvert: reject conversions on raid1 split trackchanges SubLVs
Prohibit conversions of raid1 split trackchanges SubLVs
because they will fail to get merged back into the RaidLV.

Resolves: rhbz1579438
(cherry picked from commit 8b0729af0f)

Conflicts:
	WHATS_NEW
2018-07-26 14:01:37 +02:00
Marian Csontos
5b87f5fb72 post-release 2018-07-19 18:43:10 +02:00
Marian Csontos
bb384f8488 pre-release 2018-07-19 18:35:42 +02:00
Marian Csontos
82feb5f111 WHATS_NEW 2018-07-19 18:33:59 +02:00
Zdenek Kabelac
6fcb2ba440 WHATS_NEW: update 2018-07-09 00:36:11 +02:00
Zdenek Kabelac
df8eef7096 memlock: extend exception list
Amound of linked libraries grows.
Most of them we don't need to lock in, since we are not using
them in locked section, so skip locking them in memory.
2018-07-04 13:41:08 +02:00
Zdenek Kabelac
99cddd67a9 vcfgrestore: add prompt with active volumes
Add check for active device with names matching restored VG.
When such devices are present in dm table, prompt user, if he
wish to continue.
2018-07-04 13:40:50 +02:00
Heinz Mauelshagen
b90d4b38e5 WHATS_NEW
(cherry picked from commit 11384637fb)

Conflicts:
	WHATS_NEW
2018-06-26 12:18:39 +02:00
Zdenek Kabelac
ba6ed5c90c snapshot: improve checking of merging snapshot
Add runtime detection for 'lvs -o+seg_monitor' and 'vgchange --monitor'.
This fix should avoid unnecessary timeout on systemd shutdown.
2018-06-22 15:05:22 +02:00
Zdenek Kabelac
e0c94d883a fsadm: missing -l description 2018-06-22 15:00:52 +02:00
Zdenek Kabelac
39e3b5d8ac cache: cleaner policy also uses fmt2
Format 2 is also with cleaner policy.
2018-06-22 15:00:10 +02:00
Zdenek Kabelac
39fc98d731 pvmove: improve lvs
When pvmoving LV - the target for LV is a mirror so the validation
that checked the type is matching was incorrect.

While we need a more generic enhancment of LVS output for pvmoved LVs,
for now at least stop showing internal errors and  'X' symbols in attrs.
2018-06-22 12:37:59 +02:00
Zdenek Kabelac
5503699c37 pvresize: add missing return
Log error path missed return 0.
Also fix some unneded bactraces (since log_error already shows
position).
2018-06-22 12:37:09 +02:00
David Teigland
8bd9a89c14 WHATS_NEW: recent changes 2018-06-20 14:32:29 -05:00
Marian Csontos
d88376ca78 post-release 2018-06-18 07:30:09 +02:00
Marian Csontos
6283f5ea3f pre-release 2018-06-18 07:21:51 +02:00