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

18849 Commits

Author SHA1 Message Date
Zdenek Kabelac
493af2bb16 lvm: fix reporting path with HOME envvar
When envvar HOME is not present we were using invalid path with (null).
2023-10-17 16:49:23 +02:00
Zdenek Kabelac
7e017abb30 make: generate 2023-10-17 16:48:50 +02:00
David Teigland
be9a64e654 device_id: make dmeventd use system.devices by default
When no dmeventd.devices exists, make it use system.devices
rather than no devices file at all.
2023-10-16 15:40:11 -05:00
David Teigland
a836872199 device_id: accept wwids containing QEMU HARDDISK
A wwid may be useful even when it contains the string
"QEMU HARDDISK", so allow these to be used.
2023-10-16 15:21:22 -05:00
David Teigland
d8d4260df8 device_id: improve handling of non-standard wwid prefixes 2023-10-16 15:12:12 -05:00
David Teigland
e6c6713a1b hints: correct fix for hints with device ids
Fixes commit 63b469c160
"device_id: fix hints with device ids"

It's not correct for internal filtering to be a factor
in validating the set of devs that are the basis for hints.

Instead, look for inconsistencies between a hint entry and
the corresponding devices file entry.
2023-10-16 14:13:27 -05:00
Zdenek Kabelac
d12e843e4a tests: aux mdadm_assemble skip path
If the old mdadm fails to assembly array due to its internal buggy logic
skip the test instead of failure.
2023-10-16 00:11:35 +02:00
Zdenek Kabelac
f55dc3006e tests: simplify line counting
No need for pipes
2023-10-15 21:48:22 +02:00
Zdenek Kabelac
098bc780a2 tests: better synchronization 2023-10-15 21:48:22 +02:00
Zdenek Kabelac
dfaa891281 tests: fsck with yes
Fsck may need to update metadata even after clean unmount.
2023-10-15 19:51:43 +02:00
Zdenek Kabelac
d5e58768aa tests: check for blkid
When libblkid is not present (older systems) we can't use new -fs tests at
all so skip these tests.
2023-10-15 14:43:13 +02:00
Zdenek Kabelac
63885da5b9 tests: shorting batch line output 2023-10-15 14:42:14 +02:00
Zdenek Kabelac
5cc54458b7 tests: old way to disable copy contructor
Mark them private.
2023-10-14 23:37:38 +02:00
Zdenek Kabelac
d2d8d0ab5a tests: io stream class saver
Restore io stream when changed by modifiers.
Also simplify getenv access.
2023-10-14 23:14:26 +02:00
Zdenek Kabelac
1a67bfe396 tests: extend the usability for older systems
Extend the test a bit futher so we can keep logic of resize
working similarly well for older and newer systems.

Test uses new 'aux have_fsinfo'function to regnize compiled
version of lvm.
2023-10-14 23:13:46 +02:00
Zdenek Kabelac
26766dcf73 tests: aux add have_fsinfo
Add function to detect whether lvm2 was compiled with
blkid.h with BLKID_SUBLKS_FSINFO

Currently it can be detected by support of '--fs checksize'.
2023-10-14 23:12:57 +02:00
Zdenek Kabelac
c6efab0111 cov: avoid resoure leaks on error path 2023-10-14 23:12:57 +02:00
Zdenek Kabelac
e8e5e6ee3c cov: check next_get token exists 2023-10-14 23:12:57 +02:00
Zdenek Kabelac
6afaaca2e5 cov: enusure pointer to idname exists 2023-10-14 23:12:57 +02:00
Zdenek Kabelac
9668d40d5a resize: reduce without prompt for no-fs case
Apply the same logic for 'lvreduce' which exists for newer
systems (compiled with HAVE_BLKID_SUBLKS_FSINFO)
also for older systems for one very common practical case where
the active LV does not have any blkid known signature/filesystem.

New variant recognized this situation and allowed to proceed
without requesting a prompt, while the older variant always
requested confirmation prompt.

With this patch command now works equily for both variants
for 'active LV' without signature and allows to reduce LV
without prompting.
2023-10-14 23:10:21 +02:00
Zdenek Kabelac
43020cc474 WHATS_NEW{_DM}: update 2023-10-14 01:04:10 +02:00
Zdenek Kabelac
0627716f8a configure: update 2023-10-14 01:04:10 +02:00
Zdenek Kabelac
dd7663d2ae configure.ac: enhancemetns
Simplify configuration with enabling options:
- For --enable-dmeventd automatically --enable-cmdlib.
- For --enable-dbus-service auto --enable-notify-dbus.

Fix check linux/fiemap.h for dmfilemapd.
2023-10-14 01:04:10 +02:00
Zdenek Kabelac
afe1b2bef7 debug: initialize empty string 2023-10-14 01:04:10 +02:00
Zdenek Kabelac
46eeb62b04 pool: fix recalculate of pool chunk_size
Before checking seg_type of the first area, check there is
some existing area.
Since we now support error and zero segtypes, these do not have
any PV area present.
2023-10-14 01:04:10 +02:00
Zdenek Kabelac
85c7629345 libdm: versionion symbol for enhanced dm_task_run
When new app links with current dm_task_run() that propagates ioctl()
errno - ensure it will not be usable with older version without this
supported feature.
2023-10-14 01:04:10 +02:00
Zdenek Kabelac
b162475391 makefiles: fix missing libs
Recent commit  dc8837f079
became actually to strict - we always want to build lib.a files.
2023-10-13 16:34:48 +02:00
Zdenek Kabelac
0bbbe08343 dmfilemapd: ensure program_id is initialized
Assing program_id before return 1,
and also stay C99 compatible with size_t declaration.
2023-10-13 16:04:25 +02:00
Zdenek Kabelac
0b11b08b6e tests: handle empty table better 2023-10-13 15:00:55 +02:00
Zdenek Kabelac
8b8b8ac1f8 configure: update 2023-10-13 14:33:56 +02:00
Zdenek Kabelac
9fa364414c tests: skip for missing mkfs.xfs 2023-10-13 14:33:56 +02:00
Zdenek Kabelac
1605d39b93 tests: comment about version checking to aux.sh
If there would be futher version checking needed,
make a notice there are now two -V formats.
2023-10-13 14:25:02 +02:00
Zdenek Kabelac
be2b3d5ab8 tests: increase delay 2023-10-13 14:25:02 +02:00
Zdenek Kabelac
061c008e15 tests: some minor enhancement of udev test
Reduce pgrep usage.
2023-10-13 14:25:02 +02:00
Zdenek Kabelac
53da646495 tests: fail tests when machine have suspended devs
If the machine has suspended devices present in the DM table,
it's better to fail the test.
2023-10-13 14:25:02 +02:00
Zdenek Kabelac
627535f33e tests: use function to restart dmeventd
Move restart to single function.
2023-10-13 14:25:02 +02:00
Zdenek Kabelac
f117d47ffa configure.ac: version checking for new dmpd tools
New rust version of thin_check returns now also binary name in version,
so adapt the version checking to handle this variant.
2023-10-13 14:25:02 +02:00
Zdenek Kabelac
48fd9fbd02 configure.ac: support for static linking
Introduce couple configure options:

--without-blkid
--without-systemd
--without-udev

These can be useful for build with --disable-shared
where those libraries are often distibuted without
their static libraries.

However such compiled static binaries then have limitted usage.
2023-10-13 14:25:02 +02:00
Adam Joseph
dc8837f079 configure.ac: handle --disable-shared flag
Since LVM 2.02 it appears that compiling LVM on a platform which
lacks a shared library linker/loader will fail to produce any
binaries (dmsetup, lvm2, etc).

Adds support for the standard --disable-shared flag, and
use it to disable attempts at building shared libraries.

Modified-by: zkabelac
2023-10-13 14:25:02 +02:00
Zdenek Kabelac
fb124f0839 device_mapper: pair with libdm _create_and_load_v4
Apply same enhancement also for internal device mapper library
from the commit: 25ef7a7b1a.
2023-10-13 14:24:49 +02:00
Bryn M. Reeves
0ff027ae2c dmstats: only generate aux data separator if group tag is defined
Fix a bug in _stats_set_aux() that causes bogus data to appear
in the 'userdata' field of stats reports when previously grouped
regions are ungrouped:

/var/tmp/File With Spaces: Created new group with 1 region(s) as group ID 0.

Removed group ID 0 on fedora-root

Name             GrpID RgID ObjType RgStart RgSize  #Areas ArSize  ProgID  UserData
fedora-root          -    0 region    6.39g 100.00m      1 100.00m dmstats #-
                                                                           ^^
This is the aux_data separator character followed by empty user data.
The _stats_set_aux() function should only emit the separator if
there is a valid group descriptor for the region.
2023-10-12 11:31:14 +00:00
Bryn M. Reeves
995c7b503b Add more dmstats integration tests
Add new tests for filemap, group/ungroup, histograms, precise timestamps
and userdata.
2023-10-12 11:31:14 +00:00
Bryn M. Reeves
9aa47f9768 Quote path value in --filemap debug messages
Improves readability of debugging output when file paths contain
whitespace.
2023-10-12 11:31:14 +00:00
Bryn M. Reeves
7d8981dd3f dmstats: support group aliases with embedded whitespace
Creating a group with a name that contains whitespace causes an error in
the @stats_set_aux message:

device-mapper: message ioctl on  (253:0) failed: Invalid argument
Could not create regions from file /var/tmp/File With Spaces.

Fix this by quoting the group alias and backslash escaping any
embedded space characters.
2023-10-12 11:31:14 +00:00
Bryn M. Reeves
33931431c3 Refactor _stats_parse_list_region()
Refactor the function that parses regions from @stats_list data to
separate the parsing of variable string data from the fixed parts
of the @stats_list response.
2023-10-12 11:31:14 +00:00
Bryn M. Reeves
ac41deeeac Rename _stats_set_aux() argument
The aux_data argument of _stats_set_aux() is the user-defined data
to be stored with the stats region. Rename the argument to better
reflect this.
2023-10-12 11:31:14 +00:00
Bryn M. Reeves
f0fd03b122 dmstats: use correct value for precise in _stats_create_file() 2023-10-12 11:31:14 +00:00
Bryn M. Reeves
eda99fc383 Clean up group struct in _stats_create_group() error path
Fix a double free in the error path from _stats_create_group() by
clearing the group struct embedded in the dm_stats handle before
returning:

    device-mapper: message ioctl on  (253:0) failed: Invalid argument
    Could not create regions from file /var/tmp/File With Spaces.
    free(): double free detected in tcache 2
    Aborted (core dumped)
2023-10-12 11:31:14 +00:00
Lennart Poettering
25ef7a7b1a _create_and_load_v4: propagate ioctl errors back to caller
When setting up dm-verity devices with signed root hashes it is very
useful to have a recognizable error code when a key is not present in
the kernel keyring. Turns out the kernel actually returns ENOKEY in that
case, but this gets lost in libdevmapper.

This fixes this: in _create_and_load_v4() it copies the error code from
the ioctl from the sub-tasks back to the main task field on failure.

This is not enough to make libcryptsetup actually propagate the ENOKEY
correctly, that also needs a patch to libcryptsetup, but this is part of
the puzzle.
2023-10-11 15:35:33 +02:00
David Teigland
63b469c160 device_id: fix hints with device ids
Fix some interactions between device IDs and hints.  Hints
may limit the scanned devices which should not always trigger
a search for the PVs that were intentionally not scanned.
Hints should also be invalidated if they contain a device
that's become excluded by an internal filter such as the
device_id filter.
2023-10-10 11:47:29 -05:00