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

18562 Commits

Author SHA1 Message Date
Zdenek Kabelac
46fe47b8e0 debug: add backtraces 2023-06-23 18:08:03 +02:00
Zdenek Kabelac
a1d5fba666 aux: add configuration for thin_restore and check_restore 2023-06-23 18:06:22 +02:00
Zdenek Kabelac
aed91e49ae tests: improve test for machine_id 2023-06-23 18:06:22 +02:00
Zdenek Kabelac
39d6a9601f tests: ensure test defines its own etc dir
Compilation may configure it's own /etc path so ensure the test
has a defined location for access to this dir during testing.

Also prepare machine_id filei (with the use of uuidgen tool)
for the test.
2023-06-23 18:06:22 +02:00
Zdenek Kabelac
2cb43449ee tests: fix path to dev dir
Correct some explicit references to /dev and use $DM_DEV_DIR.
2023-06-23 18:06:22 +02:00
Zdenek Kabelac
fec3087eef thin: add cfg support for thin_restore and cache_restore
Add configurable paths for thin_restore and cache_restore.
2023-06-23 18:06:22 +02:00
Zdenek Kabelac
8d09124c62 tests: update test for automatic virtual size correction
lvm_import_vdo will adjust the virtual size within conversion
so the volume can be use without any futher tweaking.
2023-06-23 18:06:22 +02:00
Zdenek Kabelac
657dde6208 lvm_import_vdo: correct the converted virtual size
Ensure the volume after conversion has the properly aligned size to the
volume group extent size. This would be visible when using virtual size,
that cannot be divided by extent size.

Before the user had to manually adjust the size after conversion to get
access to all data stored on VDO volume.
2023-06-23 18:05:03 +02:00
David Teigland
ea6b5b694b lvcreate: allow thin snapshot syntax that broke
The command "lvcreate --type thin --snapshot ..." to create a thin
snapshot would fail.

commit d651b340e6 removed the optional
"--type thin" from the command definition "lvcreate --snapshot LV_thin",
and added --type thin as AUTOTYPE.  This was correct and should not have
changed anything if all the command defs were correct, but it broke
the "lvcreate --type thin --snapshot" case.  It reveals a problem in a
different command definintion:  "lvcreate --type thin LV_thin" that was
missing --snapshot in its OO list.
2023-06-20 15:47:01 -05:00
David Teigland
1dbb86f8c7 tests: lvresize fs mounted multiple times 2023-06-20 13:13:06 -05:00
David Teigland
7c3eca833f lvresize: fix multiple mounts
which was mistaken as a mounted LV that had been renamed.
2023-06-16 12:11:51 -05:00
David Teigland
228a8e8c1f device_id: ignore leading and trailing spaces for sys_wwid and sys_serial
Leading and trailing underscores are also ignored to handle device ids
written by previous versions which replaced all spaces with underscores.
2023-06-15 15:17:14 -05:00
Marian Csontos
f0b48a23d9 tests: Skip integrity tests if target not present 2023-06-14 13:48:51 +02:00
Marian Csontos
4cf005d395 tests: tmp is used for TMPDIR
Fixes tests failing due to previous commit 734d9791f8.
2023-06-14 13:23:41 +02:00
Zdenek Kabelac
7ac5dbfd09 WHATS_NEW: update 2023-06-09 18:01:35 +02:00
Zdenek Kabelac
9105890d43 tests: updates
Add some more complicated conversion tests.
2023-06-09 18:01:16 +02:00
Zdenek Kabelac
7f661a24c4 tests: vdo manager wrapper tool updates
Support size specification in KiB units.
Add some theoretical support for some new options from vdoprepareforlvm.
2023-06-09 18:01:16 +02:00
Zdenek Kabelac
734d9791f8 tests: tmp dir inside test dir
Keep even temporary files within testing dir so generated files are
not left behind in system's /tmp directory.
2023-06-09 18:01:16 +02:00
Zdenek Kabelac
4d64838048 cov: drop unneeded constness
If we want to have const structure - use a const pointer to avoid,
however making individual members const make it only assingle
in construct time and we already violate this logic since
we memcpy into the structure -  so drop these unnecessary consts...
2023-06-09 18:01:16 +02:00
Zdenek Kabelac
17ee5df857 vdo: man updates for lvm_import_vdo 2023-06-09 18:01:16 +02:00
Zdenek Kabelac
be6c34212b vdo: enhance lvm_vdo_import
Add support for usage of 'dm-snapshot' for doing whole device conversion
in a snapshot which could be merged once the whole conversion has been
made.
This helps with cases where there would be any unexpected failure in the
middle of conversion process and user can continue using original
device until problem in conversion is fixed.

Import tool now uses 'truncate' tool to create a small backend file (20M) for loop device
to hold COW exception store.

Option  --vdo-config has been added to allow specifing location of vdo
configuration file.

Option --no-snapshot allows to use import tool without creation of
snapshot, however recovery after finished VDO conversion and unfinished
lvm2 conversion is then very difficult.

Option --uuid-prefix allow to specify DM UUID prefix for snapshot
device.

Use read with -r.
2023-06-09 18:01:16 +02:00
Zdenek Kabelac
00633f8b66 vdo: fix and enhance vdo metadata reader
Improve metadata parser to handle volume_geometry bio_offset,
which needs to be substracted from 'region' start_block when present.

This bio_offset block is non-zero i.e. with converted VDO volumes.

Also fix some converted structure value (but they are not in use).
2023-06-09 18:01:16 +02:00
Zdenek Kabelac
fcf2057b38 cmd_enum: correct inclusion
Ensure we use generated header file for this build from -Iinclude.

Reported-by: Anton Lundin <glance@ac2.se>
2023-06-09 18:01:16 +02:00
David Teigland
74feebdab7 device_id: fix handling of non-PV with duplicate serial number
Fix in the code that matches devices to system.devices entries when
the devices have the same serial number.  A non-PV device in
system.devices has no pvid value, and the code was segfaulting
when checking the null pvid value.
2023-06-08 12:24:05 -05:00
David Teigland
8e53b3bc14 man: lvmraid update limitations 2023-06-05 10:43:51 -05:00
Peter Rajnoha
e2ecc6c763
reporter: restore report type to initial value after processing report_for_selection
If we are executing 'report_for_selection' to do an internal report
just for the selection itself (not for display), we can call it more
than once. In that case, we are reusing the same selection handle
(e.g. inside 'process_each_lv_in_vg').

The selection handle has 'report_type' field which is a union of all
report types needed for the report based on selection fields we actually
use.

The 'report_type' is further clarified based on checks and rules inside
'_get_final_report_type' which 'report_for_selection' calls. Then, this
final report type unambiguously identifies proper branch to take in
'report_all_in_{pv,vg,lv}' that is called next.

If the 'report_for_selection' is called more than once with the same
selection handle, we need to make sure that we always restore the report
type to its initial value, so all the rules inside 'report_for_selection'
are applied correctly next time.

This patch fixes the missing restoration of the 'report_type' value in
'selection_handle' that is reused for recurring 'report_for_selection'
calls.

An example scenario where this failed was with selecting an LV for
removal with "lvremove --select" while using a field in the selection
that required extra DM info or DM status call for the LV (that is,
"Logical Volume Device Info Fields" and "Logical Volume Device Status Fields"
as visible in 'lvs -S help').
2023-05-31 09:38:11 +02:00
David Teigland
0591131a53 lvreduce: simplify _lvseg_get_stripes integrity check
Simplify unnecessary loop to avoid coverity complaint.
2023-05-25 12:09:41 -05:00
David Teigland
4cdb178968 device_id: ignore trailing underscores in t10 wwid from devices file
In previous lvm versions, trailing spaces at the end of a t10 wwid would
be replaced with underscores, so the IDNAME string in system.devices
would look something like "t10.123_".  Current versions of lvm ignore
trailing spaces in a t10 wwid, so the IDNAME string used would be
"t10.123".  The different values would cause lvm to not recognize a
device in system.devices with the trailing _.  Fix this by ignoring
trailing underscores in the IDNAME string from system.devices.
2023-05-19 14:05:10 -05:00
David Teigland
24e4b6df11 tests: integrity-caching: ensure raid redundancy
The recent fix 05c2b10c5d ensures that raid LV images are not
using the same devices.  This was happening in the lvextend commands
used by this test, so fix the test to use more devices to ensue
redundancy.
2023-05-17 14:15:25 -05:00
David Teigland
3a75704756 tests: integrity: snapshots now work on raid+integrity 2023-05-17 11:10:45 -05:00
Peter Rajnoha
3b4e7d1625
toollib: provide proper hint for referencing VG uuid in case of duplicate VG names
vgrename does not support -S|--select, so do not provide a hint about
using it. Instead, provide a hint about using VG uuid directly.

❯  vgs
  WARNING: VG name vg1 is used by VGs DXjcSK-gWfu-5gLh-9Kbg-sG49-dtRr-GqXzGL and MVMfyM-sjOa-M2xV-AT4Y-JddR-h4SP-UO5Ttk.
  Fix duplicate VG names with vgrename uuid, a device filter, or system IDs.
  VG     #PV #LV #SN Attr   VSize   VFree
  vg1      1   0   0 wz--n- 124.00m 124.00m
  vg1      1   0   0 wz--n- 124.00m 124.00m

(vgrename does not support -S|--select)
❯  vgrename vg1 vg2
  WARNING: VG name vg1 is used by VGs DXjcSK-gWfu-5gLh-9Kbg-sG49-dtRr-GqXzGL and MVMfyM-sjOa-M2xV-AT4Y-JddR-h4SP-UO5Ttk.
  Fix duplicate VG names with vgrename uuid, a device filter, or system IDs.
  Multiple VGs found with the same name: skipping vg1
  Use VG uuid in place of the VG name.

(vgchange does support -S|--select)
❯  vgchange --addtag a vg1
  WARNING: VG name vg1 is used by VGs DXjcSK-gWfu-5gLh-9Kbg-sG49-dtRr-GqXzGL and MVMfyM-sjOa-M2xV-AT4Y-JddR-h4SP-UO5Ttk.
  Fix duplicate VG names with vgrename uuid, a device filter, or system IDs.
  Multiple VGs found with the same name: skipping vg1
  Use --select vg_uuid=<uuid> in place of the VG name.
2023-05-16 17:17:55 +02:00
David Teigland
fd6e113bba raidintegrity: allow snapshots 2023-05-11 11:02:52 -05:00
heinzm
05c2b10c5d Fix "multisegment RAID1, allocator uses one disk for both legs"
In case of e.g. 3 PVs, creating or extending a RaidLV causes SubLV
collocation thus putting segments of diffent rimage (and potentially
larger rmeta) SubLVs onto the same PV.  For redundant RaidLVs this'll
compromise redundancy.  Fix by detecting such bogus allocation on
lvcreate/lvextend and reject the request.
2023-05-10 18:35:21 +02:00
Zdenek Kabelac
bf794b66f4 tests: more updates for 300M xfs
Fix some sizing for larger xfs testing.
Also fix resize of reiserfs which requires resize_fsadm.
2023-05-10 16:19:46 +02:00
Zdenek Kabelac
bc28082b99 tests: skip this testing without newer blkid
Testing xfs --fs functionality needs new blkid.
2023-05-10 16:19:46 +02:00
Zdenek Kabelac
d418fc14f4 cov: hide some false positives
Hide some false positives.

Note: there must not a be blank line after coverity hiding comment.
2023-05-10 16:19:46 +02:00
Zdenek Kabelac
cc7c41abbd cov: remove unneeded header file inclusion 2023-05-10 15:27:48 +02:00
Zdenek Kabelac
7b52a663a6 cov: validate dev_get_primary_dev result
Make sure primary_dev is defined when using it.
2023-05-10 15:27:48 +02:00
Zdenek Kabelac
0cc5c2203b tests: needs to be exported for tracing 2023-05-06 22:43:22 +02:00
Zdenek Kabelac
7267322fc1 tests: adapt for xfs 300M min size
Some test still were missed to be converted for XFS 300M min size.
2023-05-06 22:43:22 +02:00
Zdenek Kabelac
4af8063c96 tests: different check for mounted volume
It appears newer mount allows repeated mounting ??
Anyway - do the check with grep.
2023-05-06 22:43:22 +02:00
Zdenek Kabelac
2fde4b6baa tests: check for lvmdbusd running in the system
Check for running (possibly leftover) lvmdbusd running in the
system - as this daemon may interfere with this test as in this
case both be operating on same  'live' data in /run/lvm.
2023-05-06 22:43:22 +02:00
Zdenek Kabelac
aa19f2aa3d tests: update lvextend tests
Make test faster by agregating sets of operation to work on a single
created filesystem yet checking all the variants of extension and reduction.

Split 'xfs' part into separate test and convert it for use of the
minimal size 300M nowdays required by mkfs.xfs.
2023-05-06 22:43:22 +02:00
Zdenek Kabelac
6e8ede833b aux: retry brd removal
Try to remove brd twice if there is some collision with udevd.
Instanciate only 1 ramdisk.
Use just 'eval' for '--nameprefixes' results.
2023-05-06 22:41:23 +02:00
Zdenek Kabelac
87eae82195 aux: wipefs_a takes list of devices
Enhance function to take list of device so set of devices
can be wiped with a single call:

aux wipefs_a  "$dev1" "$dev2"
2023-05-06 22:40:23 +02:00
Zdenek Kabelac
534269d0fb vdo: document feature option 2023-05-06 20:38:57 +02:00
Zdenek Kabelac
58293173cf cov: check syscall result 2023-05-06 20:38:57 +02:00
Zdenek Kabelac
f038fc3b17 cov: remove unused but set variables 2023-05-06 20:38:57 +02:00
Zdenek Kabelac
c451d7925d cleanup: correcting some log_print
Correcting to log_print_unless_silent(),
so -qq can do some work.
2023-05-06 20:38:49 +02:00
Zdenek Kabelac
39b2bd06b8 cov: some initializers 2023-05-06 19:22:05 +02:00