1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-02-07 05:58:00 +03:00

15740 Commits

Author SHA1 Message Date
Zdenek Kabelac
e5cdb114a6 pvmove: add missing synchronization
Between 'resume' and 'remove' we need to wait for udev to synchronize,
otherwise udev may 'skip' resume event processing if the udev node
is already gone.
2019-08-20 12:59:05 +02:00
Zdenek Kabelac
73d1646a00 pvmove: correcting read_ahead setting
When pvmove is finished, we do a tricky operation since we try to
resume multiple different device that were all joined into 1 big tree.

Currently we use the infromation from existing live DM table,
where we can get list of all holders of pvmove device.
We look for these nodes (by uuid) in new metadata, and we do now a full
regular device add into dm tree structure.  All devices should be
already PRELOAD with correct table before entering suspend state,
however for correctly working readahead we need to put correct info
also into RESUME tree.  Since table are preloaded, the same table
is skip and resume, but correct read ahead is now set.
2019-08-20 12:59:05 +02:00
David Teigland
881f49a767 man lvmthin: remove nonexistent topic 2019-08-19 14:09:43 -05:00
Heinz Mauelshagen
474963573a Revert "pvmove_poll: instrument"
This reverts commit fdb014f02fe67d3a8455c919516e752ec07e9b04.

Went in by mistake!
2019-08-19 17:35:52 +02:00
Heinz Mauelshagen
9e438b4bc6 dmeventd: avoid bail out preventing repair in raid plugin
Problem:
even though dead raid component devices are detected, the
raid plugin is bailing out thus preventing a repair attempt.

Rational:
in case of component device errors, the MD resynchronization
thread runs in parallel with the thrown event being processed
by the raid plugin.  The plugin retrieves the raid device status
but that still reflects insync regions as 0 (when it should
already be total regions) because the MD thread didn't update it yet.

Solution:
Remove the insync regions check and let lvconvert carry out its
pre-repair checks and optionally carry out a repair attempt.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1560739
Related:  https://bugzilla.redhat.com/show_bug.cgi?id=1468590
Related:  https://bugzilla.redhat.com/show_bug.cgi?id=1654860
Related:  https://bugzilla.redhat.com/show_bug.cgi?id=1729303
Related:  https://bugzilla.redhat.com/show_bug.cgi?id=1741016
2019-08-16 18:08:22 +02:00
Heinz Mauelshagen
fdb014f02f pvmove_poll: instrument 2019-08-14 21:40:26 +02:00
Zdenek Kabelac
4a3e1ac740 exported_symbols: comment old symbols
Fix versioning for updated symbols dm_stats_create_region
and dm_stats_create_region.

Only the latest symbol should have global entry.

Since I'm not sure what is currenlty the best option for
old symbols - we added support for easy commenting of them
(so we do not lose information when the symbol appeared
for the first time.)

Note: some old already deleted symbols should have been
restored as comments.
2019-08-07 15:28:55 +02:00
Zdenek Kabelac
f39141ebc1 make: support comments in exported symbols
Now the lines starting with '#' in exported symbols files are treated as
comments (ignored).
2019-08-07 15:27:25 +02:00
David Teigland
5ddd1ead2d vgchange: don't fail monitor command if vg is exported
When monitoring, skip exported VGs without causing a command
failure.

The lvm2-monitor service runs 'vgchange --monitor y', so
any exported VG on the system would cause the service to
fail.
2019-07-31 13:18:58 -05:00
David Teigland
b387d026bd WHATS_NEW: fix large physical block size 2019-07-30 16:14:46 -05:00
David Teigland
a178ad0858 tests: large-physical-sector-size 2019-07-30 16:12:45 -05:00
David Teigland
7550665ba4 Fix rounding writes up to sector size
Do this at two levels, although one would be enough to
fix the problem seen recently:

- Ignore any reported sector size other than 512 of 4096.
  If either sector size (physical or logical) is reported
  as 512, then use 512.  If neither are reported as 512,
  and one or the other is reported as 4096, then use 4096.
  If neither is reported as either 512 or 4096, then use 512.

- When rounding up a limited write in bcache to be a multiple
  of the sector size, check that the resulting write size is
  not larger than the bcache block itself.  (This shouldn't
  happen if the sector size is 512 or 4096.)
2019-07-25 17:06:43 -05:00
David Teigland
3d980172b0 vgrename: use global lock
Should fix a reported problem of pvs seeing bad orphan
info while vgrename was running.
2019-07-22 12:22:12 -05:00
Heinz Mauelshagen
e3c8cebd87 lvconvert: allow --stripes/--stripesize in 'mirror' conversions
This allows the creation of a striped mirror leg(s) during upconvert
by adding lvconvert command line options --stripes/--stripesize
for 'mirror' to tools/command-lines.in.

In case multiple mirror legs are being added, all will have the
same requested striped layout.

Resolves: rhbz1720705
2019-07-08 19:14:11 +02:00
Zdenek Kabelac
2f846697fc tests: add settle wait before issue remove
Some older BB with older cryptsetup tool do not 'retry' on remove
and when  remove is issued right after 'fsck'  - it might be
rejected with:

Device @PREFIX@-tcrypt2 is busy.

Try to use udevadm settle.
2019-07-06 01:24:28 +02:00
David Teigland
cff9bff0af tests: fsadm-crypt.sh update mkfs parameter
mkfs.xfs was rejecting previously working value
2019-07-06 01:24:28 +02:00
Zdenek Kabelac
143aca25da tests: split args
Here we want args to be splited into individual strings.
2019-07-06 01:24:28 +02:00
Zdenek Kabelac
1e9c409a3e tests: use luks1 for test
Since we do not need anywhere luks2 - pick older format
which does not require password for resize to keep
the rest of test unmodified.
2019-07-06 01:24:28 +02:00
Zdenek Kabelac
e1cc409ae6 tests: raise minsize of xfs
mkfs.xfs now needs at least ~1600...
2019-07-06 01:24:28 +02:00
Zdenek Kabelac
721a172edf cov: avoid recursive self-inclusion
Include: toolcontext.h -> dev-type.h -> label.h -> toolcontext.h
Replace with struct predeclaration.
2019-07-06 01:24:28 +02:00
Zdenek Kabelac
23478d9d21 cov: release iterator on error path
Another missed release on error path.
2019-07-06 01:24:28 +02:00
Zdenek Kabelac
b0e1019add gcc: clean uninitialized var warning
Some older gcc versions shows this (FP) warning:
label/label.c:360: warning: â€sector’ may be used uninitialized in this function
2019-07-06 01:24:28 +02:00
Zdenek Kabelac
9aedf68c32 gcc: cleanup warning of shawhing a global dclr
misc/lvm-globals.c:76: warning: declaration of â€use_aio’ shadows a global declaration
misc/lvm-globals.h:63: warning: shadowed declaration is here
2019-07-06 01:24:28 +02:00
Zdenek Kabelac
ea036ecfd3 libdm: implement search for device names for older kernels
Kernels <2.6.27 don't have /sys/dev dir - add code for looking
out device name via longre seach in /sys/block

This makes commands like 'dmsetup dep -o blkdevname' working.
2019-07-06 01:24:28 +02:00
Peter Rajnoha
1650c10438 udev: do not overwrite ID_MODEL in 69-dm-lvm-metad.rules
We've been assigning this in 69-dm-lvm-metad.rules:

  ENV{ID_MODEL}="LVM PV $env{ID_FS_UUID_ENC} on /dev/$name"

This was for the description to appear for each systemd device
unit representing this device, for example:

  $systemctl -a | grep "LVM PV"
  dev-block-252:2.device                                                                                         loaded    active   plugged   LVM PV JhxC7B-YTgk-3jIU-5GVo-c4gV-W8t3-UUz06p on /dev/vda2 2
  dev-disk-by\x2did-lvm\x2dpv\x2duuid\x2dJhxC7B\x2dYTgk\x2d3jIU\x2d5GVo\x2dc4gV\x2dW8t3\x2dUUz06p.device         loaded    active   plugged   LVM PV JhxC7B-YTgk-3jIU-5GVo-c4gV-W8t3-UUz06p on /dev/vda2 2
  ...

However, there could be an actual ID_MODEL that people are interested in
more than the fact that this is an LVM PV and so we shouldn't overwrite
the value.

Also, we already have a symlink /dev/disk/by-id/lvm-pv-uuid-<PV_UUID>
created which is then reflected as device unit (all device's symlinks
have systemd device unit representation) so we can still reach this
information in systemd unit listings even without setting the ID_MODEL.

Reported here: https://github.com/lvmteam/lvm2/issues/21
2019-07-04 13:06:44 +02:00
David Teigland
b13ebfa4c2 pvremove/vgextend: fix using device aliases with lvmetad
These commands were looking for the requested device alias
before dev_cache_scan had created the list of devs on the
system, so they would fail and report the dev wasn't found.
2019-06-26 16:06:23 -05:00
Zdenek Kabelac
b62c0787de cov: remove unused headers 2019-06-25 17:34:56 +02:00
Zdenek Kabelac
ff2bf11360 cov: ensure cname exists before derefering it
Just make it clear to analyzers  cname can't be NULL.
TODO: maybe exclude NULL at front of the function...
2019-06-25 17:34:18 +02:00
Zdenek Kabelac
7232458b6c cov: validate pagesize is not negative
As _init_free_list() cannot accept negative numbers
2019-06-25 17:33:47 +02:00
Zdenek Kabelac
8bea252a63 cov: clearer condition check
Make the code more obvious.
2019-06-25 17:33:47 +02:00
Zdenek Kabelac
66665f5e42 cov: add stack tracing for error paths
Add missing stack reports on error paths.
2019-06-25 17:33:25 +02:00
Zdenek Kabelac
5cf1c61152 cov: check for socket_path being set
As we check for existince on entering path
let's ensure it's there also on exit path.
2019-06-25 17:33:25 +02:00
Zdenek Kabelac
2cd6cd3439 cov: check lv_info
Use lv_info results only when valid.
2019-06-25 17:32:44 +02:00
Zdenek Kabelac
82e7426028 cov: check result of dev_get_block_size 2019-06-25 17:32:44 +02:00
Zdenek Kabelac
862899cc88 cov: check result of dev_read_bytes 2019-06-25 17:32:44 +02:00
Zdenek Kabelac
09aafb61e3 cov: release iterator on error path 2019-06-25 17:32:44 +02:00
Zdenek Kabelac
3b42cdad0c cov: unlock lvm2 mutex on error path
Add missing unlock call on theretical error path where
we would be missing our configured command.
2019-06-25 17:31:39 +02:00
Zdenek Kabelac
49813abc00 tests: for cluster always use exlusive mirrors
So to check the reason of failure is not influenced by missing cmirrord.
2019-06-21 14:51:17 +02:00
Zdenek Kabelac
788d89c412 tests: accept also value 512
Older kernels provide fixed value 512 instead of 0.
2019-06-20 14:20:35 +02:00
Zdenek Kabelac
e0a176f49a tests: properly enforce v1
Since with smq policy we can still pick format v2 - enforce
format v1 explicitely.
2019-06-20 11:21:59 +02:00
Zdenek Kabelac
24186cd9ce tests: drop unwanted backup 2019-06-20 11:21:59 +02:00
Zdenek Kabelac
2806e6265f tests: for cluster testing we always need exclusive mirrors
Cluster test would fail without exlusively activated mirror.
FIXME: test is still broken, since LV2 is not active after split.
2019-06-20 11:21:59 +02:00
Zdenek Kabelac
02a5921cdb tests: check for installed time command
If the /usr/bin/time command is not installed, skip test
(do not want to use shells' built-in).
2019-06-20 11:21:08 +02:00
Zdenek Kabelac
b61c89b52b tests: update resize value
Since we now properly extend also _pmspare - there was not enough free
space to add 8extents to both volumes.
2019-06-20 10:55:55 +02:00
Zdenek Kabelac
78c937552a tests: simplify some var settings
scan_lvs now automatically comes with extend_filter_LVMTEST
2019-06-20 00:05:46 +02:00
Zdenek Kabelac
a311684c4a aux: fix selecting lvmconf values
For older bashes (i.e. rhel5) code can't use internal bash arrays
and uses old-school greps and sorts to create configuration file.
But the split of value was mismatching names with same prefix
so  i.e.

devices/scan
devices/scan_lvs

was matching always the later one - fix this by expecting
whitespace or '=' after the name.
2019-06-20 00:05:46 +02:00
David Teigland
f3a87a2c2e Revert "lvconvert: disable linear to mirror of active LV in cluster VG"
This reverts commit 8623e336513c6ac6fcb24aa7e2ef10b8a3a36c59.

The problem this was avoiding now seems to be fixed by
commit d6bce036155ae973c869bdce3ca5f824f933f599
  mirror: fix monitoring change
2019-06-19 10:40:37 -05:00
Zdenek Kabelac
1727df7c98 tests: check mirror with clvmd and dmeventd 2019-06-19 13:38:57 +02:00
Zdenek Kabelac
29ae8b8ca5 tests: fix ra checking
Since with some installed package like 'tuned' the value of 'RA' on
PV origin device can be different, adapting tests to count with this.
2019-06-19 13:37:11 +02:00
Zdenek Kabelac
e80ca65d30 tests: replaces grep -q usage
Since we use 'set -euE -o pipefail' for shell execution,
any failure of any command in the 'piped' shell can result
in failure of whole executed chain - resulting in typically
unsually test skip, that was left unnoticed.

Since checked command have usually short output, the simplest
fix seems to be to let grep parse whole output instead
of quiting after first match.
2019-06-19 13:36:58 +02:00