1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00
Commit Graph

19345 Commits

Author SHA1 Message Date
Zdenek Kabelac
d8acbaf1c6 configure.ac: add support for libnvme
Add 2 new options for linking  libnvme with lvm2.
Option  --without-libnvme, --disable-nvme-wwid

(cherry picked from commit cb87e184bc)
2024-12-18 15:45:56 +01:00
David Teigland
f36ddaf72b device_id: nvme devices may use alternate wwids
Device quirks may cause sysfs wwid file to change what it
displays, from a bogus eui... string to an nvme... string.

The old wwid may be saved in system.devices, so recognizing
the device requires finding the old value from libnvme.

After matching the old bogus value using libnvme, system.devices
is updated with the current sysfs wwid value.

(cherry picked from commit d952358636)
2024-12-18 15:43:24 +01:00
Zdenek Kabelac
e4890763b6 device_id: close only opened dir
After more of opendir, make sure 'dir' is closed
only when it's been opened.

(cherry picked from commit edfa4955d8)
2024-12-18 15:43:10 +01:00
Zdenek Kabelac
d6229041a5 devicesfile: move opendir after fclose
Call opendir() after new file is stored within dir,
otherwise this new file would not accounted.

(cherry picked from commit 2c5bf25187)
2024-12-18 15:42:49 +01:00
Peter Rajnoha
2371383de6 device_id: fix segfault if devices file has PVID=.
(cherry picked from commit 8e3db44036)
2024-12-18 15:42:22 +01:00
Zdenek Kabelac
497d9406ee cleanup: use single array for idtype string
Share string array for de/coding idtype.

(cherry picked from commit caa0e08738)
2024-12-18 15:41:44 +01:00
Heinz Mauelshagen
a5672ff088 lv_manip: avoid unreleased memory pool(s) message on RAID extend
In case of different PV sizes in a VG, the lvm2 allocator falls short
to define extended segments resiliently asked for 100%FREE RaidLV extension
and a RAID distinct allocation check fails.  Fix is to release a memory pool
on the resulting error path.

Until the lvm2 allocator gets enhanced (WIP) to do such complex (and other)
allocations proper, a workaround is to extend a RaidLV to any free space on
its already allocated PVs by defining those PVs on the lvextend command line
then iteratively run further such lvextend commands to extend it to its
final intended size.  Mind, this may be a non-trivial extension interation.

(cherry picked from commit 557b2850ce)
2024-08-07 16:59:27 +02:00
David Teigland
a6dec74334 lvmlockd: allow forced vgchange locktype from none
vgchange --locktype sanlock|dlm --lockopt force <vgname>
can be used to change the lock type without lvmlockd or
the lock manager involved.

(cherry picked from commit 4dc009c872)
2024-07-09 19:34:06 +02:00
David Teigland
0bb9ae53db lvmlockd: avoid lockd_vg for local VGs
Previously, a command would call lockd_vg() for a local VG,
which would go to lvmlockd, which would send back ENOLS,
and the command would not care when it saw the VG was local.
The pointless back-and-forth to lvmlockd for local VGs can
be avoided by checking the VG lock_type in lvmcache (which
label_scan now saves there; this wasn't the case back when
the original lockd_vg logic was added.)  If the lock_type
saved during label_scan indicates a local VG, then the
lockd_vg step is skipped.

(cherry picked from commit bf60cb4da2)
2024-07-09 19:33:03 +02:00
Marian Csontos
d94090dae6 scripts: Install services for devices file init
Services introduced in commit c609dedc2f
need installing.

(cherry picked from commit 1b9bf5007b)
2024-07-09 19:32:49 +02:00
David Teigland
4b33a5a399 vgimportdevices: skip global lockd locking
Fix commit b65a2c3f3a "vgimportdevices: skip lvmlockd locking"
which intended to disable lvmlockd locking, but the lockd_gl_disable
flag was mistakenly set after lock_global() so it wasn't effective.
This caused vgimportdevices to fail unless locking was started.

(cherry picked from commit a8b8e1f074)
2024-07-09 19:30:29 +02:00
Zdenek Kabelac
fe58f4b87a lvm: fix shell completion
Previous commit 82617852a4
introduce bug in complession - as the rl_completion_matches()
needs to always advance to next element where the index
is held in static variable.

Add comment about this usage.

(cherry picked from commit 73298635b9)
(cherry picked from commit c33b0e1187)
2024-07-09 19:29:03 +02:00
David Teigland
16af82a5af Allow system.devices to be automatically created on first boot
An OS installer can create system.devices for the system and
disks, but an OS image cannot create the system-specific
system.devices.  The OS image can instead configure the
image so that lvm will create system.devices on first boot.

Image preparation steps to enable auto creation of system.devices:
- create empty file /etc/lvm/devices/auto-import-rootvg
- remove any existing /etc/lvm/devices/system.devices
- enable lvm-devices-import.path
- enable lvm-devices-import.service

On first boot of the prepared image:
- udev triggers vgchange -aay --autoactivation event <rootvg>
- vgchange activates LVs in the root VG
- vgchange finds the file /etc/lvm/devices/auto-import-rootvg,
  and no /etc/lvm/devices/system.devices, so it creates
  /run/lvm/lvm-devices-import
- lvm-devices-import.path is run when /run/lvm/lvm-devices-import
  appears, and triggers lvm-devices-import.service
- lvm-devices-import.service runs vgimportdevices --rootvg --auto
- vgimportdevices finds /etc/lvm/devices/auto-import-rootvg,
  and no system.devices, so it creates system.devices containing
  PVs in the root VG, and removes /etc/lvm/devices/auto-import-rootvg
  and /run/lvm/lvm-devices-import

Run directly, vgimportdevices --rootvg (without --auto), will create
a new system.devices for the root VG, or will add devices for the
root VG to an existing system.devices.

(cherry picked from commit c609dedc2f)
(cherry picked from commit 3321a669d8)
2024-07-09 19:28:56 +02:00
Marian Csontos
7d1b418ad8 WHATS_NEW: update 2024-05-16 15:49:58 +02:00
Marian Csontos
147498a07f Revert "10-dm-rules: don't restore DM_UDEV_DISABLE_OTHER_RULES_FLAG from db"
This reverts commit f98d020ead.
2024-05-16 15:49:58 +02:00
Marian Csontos
cc3214c244 Revert "11-dm-lvm.rules: don't restore DM_UDEV_DISABLE_OTHER_RULES_FLAG from db"
This reverts commit 2b2f11a74c.
2024-05-16 15:49:58 +02:00
Marian Csontos
2e2303dd55 Revert "dm udev rules: don't export and save DM_SUSPENDED"
This reverts commit 21ca92c432.
2024-05-16 15:49:58 +02:00
Marian Csontos
da6319b9f5 Revert "dm udev rules: don't export and save DM_NOSCAN"
This reverts commit a196752969.
2024-05-16 15:49:58 +02:00
Marian Csontos
d6b3f4f4dd Revert "10-dm.rules: bump DM_UDEV_RULES_VSN to 3"
This reverts commit 038f9254d9.
2024-05-16 15:49:57 +02:00
Marian Csontos
645992ca32 RHEL9 2024-05-16 15:37:58 +02:00
Marian Csontos
90ec2cd92f pre-release 2024-05-16 12:12:06 +02:00
Marian Csontos
15413226a8 pages: Use gitlab pages and ikiwiki for doc 2024-05-16 12:00:26 +02:00
Marian Csontos
5906f44bee doc: Update TESTING file 2024-05-16 11:32:43 +02:00
Zdenek Kabelac
32b2776afc makefiles: use properly defined varitable
Variable used for tracking dependencies is USE_TRACKING.
2024-05-14 17:59:26 +02:00
Zdenek Kabelac
a0c5b2c9fd tests: add basics for dm_hash unit testing
Better code coverage.
2024-05-14 17:59:26 +02:00
Zdenek Kabelac
e59c84ca3a gcc: clean cast with -Wbad-function-cast
Makes gcc happier.
2024-05-14 17:59:26 +02:00
Zdenek Kabelac
e3dff2cba2 gcc: same signess 2024-05-14 17:59:26 +02:00
Zdenek Kabelac
7d22be22d9 gcc: use proper commnent 2024-05-14 17:59:26 +02:00
Zdenek Kabelac
e08e5a5a07 gcc: better initilizer for older gcc compilers
So use  { { } }.
2024-05-14 17:59:26 +02:00
Zdenek Kabelac
915267c900 activation: log_debug_activation
Correcting debug class.
2024-05-14 17:59:16 +02:00
Zdenek Kabelac
c2c028c680 tests: reduce number of created LVs
lvm2 for a while already optimizes 'vgremove' operation to
a single commit when possible if all LVs can be
easily deactivated.

So the number of LVs doesn't matter much - but the tested
case 'test_delete_non_complete_job' seems to be taking
some time anyway to capture the exception.

So just reducing the running time of the test significatanly
as we don't need to create 64LVs for 4 'execution mode' runs.
2024-05-13 18:04:34 +02:00
Zdenek Kabelac
a86fb27607 cov: ensure pointer has defined value
Add initialization of 'fin' pointer.
2024-05-13 17:32:46 +02:00
Zdenek Kabelac
c6b5eb5b50 dmfilemapd: assign 0 to integer
Avoid mixing enumeration assign with 0, so just pick some integer
from filemap_monitor,  stucture will be fully zeroed anyway....
2024-05-13 17:32:46 +02:00
Zdenek Kabelac
d58a2644e6 libdevmapper-event: correct switch break
Replace 'continue' within 'switch' statement with correct break.
2024-05-13 17:32:46 +02:00
David Teigland
aafa22e643 man: lvmlockd: remove dash in option name
for consistency with other man pages
2024-05-13 09:16:20 -05:00
Zdenek Kabelac
af983ad3d3 lvmcmdline: check for NULL
Althought this code likely never is hit with NULL, just add
check to be sure.
2024-05-13 14:49:54 +02:00
Zdenek Kabelac
c0e7cdff9d cov: enusure _table doesn't leak
If someone would enter _table multiple times by mistatek,
there is 'teroretical' leak - although doesn't matter much
in this case...
2024-05-13 14:48:46 +02:00
Zdenek Kabelac
a1a1e13dbe make: generate 2024-05-13 12:58:37 +02:00
Zdenek Kabelac
60bad2f22d lv_types: sort order of types
Order is used for man page generation (although not completely).
So place  'zero & error' to the end of list.
Keep  linear,striped,snapshot in front.
For the rest use alphabetic order.
2024-05-13 12:58:37 +02:00
Zdenek Kabelac
026344e8cc cleanup: local const arrays
No need for relocation entries for locally used arrays.
2024-05-13 12:58:37 +02:00
Zdenek Kabelac
ee3be2807f cleanup: static missed _ 2024-05-13 12:58:37 +02:00
Zdenek Kabelac
d25c43c8cd cleanup: remove unuable code path
Eliminate some ancient unreachable code
for historical version of libdm.
2024-05-13 12:58:37 +02:00
Zdenek Kabelac
ffdceeb982 cleanup: some missed public symbols static 2024-05-13 12:58:19 +02:00
Zdenek Kabelac
74e487f3a9 label: make scan_bcache local
Seems there are no users of scan_bcache, so make it local.
TODO: such variable should be ideally in cmd_context.
2024-05-13 02:21:37 +02:00
Zdenek Kabelac
8da0ab6fc1 cleanup: drop unused declared struct 2024-05-13 02:21:37 +02:00
Zdenek Kabelac
c7a9a1fb6c cleanup: use static vars
Drop global visibility.
2024-05-13 02:21:37 +02:00
Zdenek Kabelac
46669fe9e8 cleanup: add static _ 2024-05-13 02:21:37 +02:00
Zdenek Kabelac
5b7e30da76 lv_type: simplier macro usage
Use more simple macros - as there is likely not going to happen
any macro replacement - so use more effient structure layout.
2024-05-13 02:21:28 +02:00
Zdenek Kabelac
429ab45a1c lv_prop: simplier macro usage
Use more simple macros - as there is likely not going to happen
any macro replacement - so use more effient structure layout.
2024-05-13 02:20:29 +02:00
Zdenek Kabelac
f86bdcb6e9 command: validation code only for man-generator
Don't waste time with string order validation within command,
check within  'man-generator -c' is enough.
2024-05-13 02:18:19 +02:00