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

19566 Commits

Author SHA1 Message Date
Zdenek Kabelac
ce9c5f2f7e WHATS_NEW: update 2024-10-10 08:53:07 -05:00
Zdenek Kabelac
eea78613ef device_mapper: slight improvement of tok_match
Reduce amount of unnecessary instructions for some code paths.
2024-10-10 08:53:07 -05:00
Zdenek Kabelac
00a8946e46 import_vsn1: increate hash size
With larger amount of LV hashing buckets within VG,
until better structures for dynamic handling of LV elements will be used.
2024-10-10 08:53:07 -05:00
Zdenek Kabelac
53d5e2e602 device_mapper: slight reorder for _get_token
For most common part check for '#' when it's known it's not a space.
And also when we checked for '\n' we dont need to check again isspace().
2024-10-10 08:53:07 -05:00
Zdenek Kabelac
ce970403d6 device_mapper: nodes and values with strings
Avoid double pool allocation call by placing string
directly after the node/value structure end.

It would be likely better to not copy the string at all
and derefence it from the original string however that
is much larger rework - and also for unescaping we would
need to allocate anyway.
2024-10-10 08:53:07 -05:00
Zdenek Kabelac
4e623daf8e crc: add newer zlib code
This code is faster when calculating crc32 checksum for larger
block areas. There is also SIMD variant present in the code,
however ATM the influence on performance of lvm2 is not that big..
2024-10-10 08:53:07 -05:00
Zdenek Kabelac
e03bdcfbc2 crc: move static table
Move static table upward in the code so it can be shared with
another 'crc' implementation.
2024-10-10 08:53:06 -05:00
David Teigland
fa12a2398e config: set vg_copy_internal to binary for testing 2024-10-10 08:50:52 -05:00
David Teigland
18babdc3ac vg: copy alternative to reimporting
One vg struct is copied to another vg struct, rather than
importing vg metadata text to create the new vg struct.

Enable with global/vg_copy_internal="binary"
2024-10-09 15:49:03 -05:00
Peter Rajnoha
317fae4024
dev-type: detect mixed dos partition with gpt's PMBR
Detect when we have mixed dos partition with gpt's PMBR partition.

This is not a sane configuration, but detect it anyway, just in case
someone configures such partition layout manually and forcefully and
incorrectly defines one of the partition types to be the GPT's PMBR.

For example:

  ❯  fdisk -l /dev/sdc

  Device     Boot Start    End Sectors Size Id Type
  /dev/sdc1        2048  67583   65536  32M 83 Linux
  /dev/sdc2       67584 262143  194560  95M ee GPT

Before:
(The partition filter passes even though there's real existing dos
partition - the empty GPT PMBR overrides it.)

  ❯  pvcreate /dev/sdc
  WARNING: PMBR signature detected on /dev/sdc at offset 510. Wipe it? [y/n]:
  Wiping PMBR signature on /dev/sdc.
  Physical volume "/dev/sdc" successfully created.

With this patch applied:
(The GPT PMBR does not override the existence of the dos partition.)

  ❯  pvcreate /dev/sdc
    Cannot use /dev/sdc: device is partitioned
2024-10-03 09:55:36 +02:00
Marian Csontos
e2e6b08518 post-release 2024-10-02 14:21:43 +02:00
Marian Csontos
207990a877 pre-release 2024-10-02 14:21:09 +02:00
Marian Csontos
ec965dde39 WHATS_NEW and release-notes update 2024-10-02 14:18:35 +02:00
Peter Rajnoha
b77f7acac8
WHATS_NEW: update 2024-10-02 13:49:45 +02:00
Marian Csontos
ca02546649 [WIP] Disable dlm for RHEL10 2024-10-02 13:48:11 +02:00
Tobias Stoeckmann
493d8908fb lvmdbusd: Fix Python script
The thread does not contain field "damon" but "daemon".

Actually found with codespell.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2024-10-02 11:34:22 +00:00
Peter Rajnoha
9d6a3ee547
filesystem: add note about swap devices 2024-10-02 13:31:54 +02:00
Peter Rajnoha
bd5ca83c43
tests: also test swap devices in lvresize-fs.sh 2024-10-02 13:31:54 +02:00
Peter Rajnoha
5096335277
lv_manip: handle swap devices in fs-related checks for lvreduce/lvextend
This provides better hints when trying to resize the fs on top of an LV.
Also needs a3f6d2f593 for proper operation.

❯  lvs -o name,size vg/swap
  lv_name lv_size
  swap     60.00m

Before:

❯  lvextend -L72m vg/swap
  Size of logical volume vg/swap changed from 60.00 MiB (15 extents) to 72.00 MiB (18 extents).
  Logical volume vg/swap successfully resized.

❯  lvreduce -L60m vg/swap
  File system swap found on vg/swap.
  File system device usage is not available from libblkid.

❯  lvreduce -L50m vg/swap
  Rounding size to boundary between physical extents: 52.00 MiB.
  File system swap found on vg/swap.
  File system device usage is not available from libblkid.

After:

❯  lvextend -L72m vg/swap
  Size of logical volume vg/swap changed from 60.00 MiB (15 extents) to 72.00 MiB (18 extents).
  Logical volume vg/swap successfully resized.

❯  lvreduce -L60m vg/swap
  File system swap found on vg/swap.
  File system size (60.00 MiB) is equal to the requested size (60.00 MiB).
  File system reduce is not needed, skipping.
  Size of logical volume vg/swap changed from 72.00 MiB (18 extents) to 60.00 MiB (15 extents).
  Logical volume vg/swap successfully resized.

❯  lvreduce -L50m vg/swap
  Rounding size to boundary between physical extents: 52.00 MiB.
  File system swap found on vg/swap.
  File system size (60.00 MiB) is larger than the requested size (52.00 MiB).
  File system reduce is required and not supported (swap).
2024-10-02 13:31:54 +02:00
Peter Rajnoha
e009becd73
dev-type: get swap device size from blkid using FSSIZE
blkid does not report FSLASTBLOCK for a swap device. However, blkid
does report FSSIZE for swap devices, so use this field (and including
the header size which is of FSBLOCKSIZE for the swap) instead to
set the "filesystem last block" which is used subsequently for
further calculations and conditions.
2024-10-02 13:31:54 +02:00
Peter Rajnoha
4524778b23
tests: add pvcreate-partition.sh 2024-10-02 12:02:35 +02:00
Peter Rajnoha
d5d2c98980
dev-type: add prefix to differentiate msdos and gpt constants 2024-10-02 12:02:34 +02:00
Peter Rajnoha
84cabd068b
filter: partitioned: also detect non-empty GPT partition table
We already detect msdos partition table. If it is empty, that is, there
is just the partition header and no actual partitions defined, then the
filter-partitioned passes, otherwise not.

Do the same for GPT partition table.
2024-10-02 11:54:01 +02:00
Zdenek Kabelac
4708a354f6 make: generate 2024-09-30 15:00:03 +02:00
Zdenek Kabelac
28e7be9f39 cov: annotate 2024-09-30 15:00:03 +02:00
Zdenek Kabelac
0e1e220c3d cov: potentially overflowing expression
Use 64bit arithmentic.
2024-09-30 15:00:03 +02:00
David Teigland
7f29afdb06 lvmlockd: configurable sanlock lease sizes on 4K disks
New config setting sanlock_align_size can be used to configure
the sanlock lease size that lvmlockd will use on 4K disks.

By default, lvmlockd and sanlock use 8MiB align_size (lease size)
on 4K disks, which supports up to 2000 hosts (and max host_id.)

This can be reduced to 1, 2 or 4 (in MiB), to reduce lease i/o.
The reduced sizes correspond to smaller max hosts/host_id:

1 MiB = 250 hosts
2 MiB = 500 hosts
4 MiB = 1000 hosts
8 MiB = 2000 hosts (default)

(Disks with 512 byte sectors always use 1MiB leases and support
2000 hosts/host_id, and are not affected by this.)
2024-09-27 17:59:03 -05:00
Zdenek Kabelac
6816366ff1 WHATS_NEW: update 2024-09-27 13:44:59 +02:00
zkabelac
7447634c26 cleanup: replace use of alloced with allocated 2024-09-27 13:42:45 +02:00
zkabelac
0862e2b150 cleanup: typos in libdm 2024-09-27 13:42:45 +02:00
zkabelac
74f607952d cleanup: more typos in WHATS_NEW 2024-09-27 13:42:45 +02:00
Tobias Stoeckmann
cb781b3e1d cleanup: fix typos
Typos found with codespell.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2024-09-27 13:42:45 +02:00
Zdenek Kabelac
964012fdb9 memlock: use value of 0 to disable memory locking
In cases user is sure he is not using his 'rootfs' or 'swap' on LVs
managed with his command - it possible to completely bypass pinning
process to RAM which may eventually slightly speedup command execution,
(however at the risk the process can be eventually delayed by swapping).
Basicaly use this only at your risk...

TODO: add some dmeventd support for this.
2024-09-27 13:42:45 +02:00
Zdenek Kabelac
7e2bb2a35e vdo: depcreate unused settings 2024-09-26 16:25:12 +02:00
David Teigland
e9413fb211 lvmlockd: use lvmlock LV size
Previously, lvmlockd detected the end of the lvmlock LV
by doing i/o to it until an i/o error was returned.
This triggered sanlock warning messages, so use the LV
size to avoid accessing beyond the end of the device.

Previously, every lvcreate would refresh the lvmlock LV
in case another machine had extended it.  This involves
a lot of unnecessary work in most cases, so now compare
the LV size and device size to detect when a refresh is
needed.
2024-09-26 08:53:09 -05:00
David Teigland
9d7c19c2ce lvmlockd: fix previous thin locking fix
Restore the original lvremove locking for non-thin LVs
that were changed in the thin locking fix.
2024-09-23 17:15:42 -05:00
David Teigland
d7a028aaad vg: remove unused hostnames hash table
The hash table of lv creation hostnames was not used for anything,
so remove it.
2024-09-23 15:04:53 -05:00
David Teigland
1c3d7dfb07 lvmlockd: fix locking for thin
lvremove of a thin lv while the pool is inactive would
leave the pool locked but inactive.

lvcreate of a thin snapshot while the pool is inactive
would leave the pool locked but inactive.

lvcreate of a thin lv could activate the pool to check
a threshold before the pool lock was acquired in lvmlockd.
2024-09-23 14:57:07 -05:00
Peter Rajnoha
86a9db05cf
tests: remove superfluous -a option for df used in lvresize-fs.sh 2024-09-19 15:12:44 +02:00
David Teigland
f42aef4706 metadata: use lv_hash in segment-specific metadata parsing
The lv_hash wasn't being passed to the seg-specific text import
functions, so they were doing many find_lv() calls which consumes
a lot of time when there are many LVs in the metadata.
2024-09-10 11:51:15 -05:00
David Teigland
1b68841605 args: readonly description update
Include reference to --permission r.
2024-09-06 08:44:06 -05:00
Peter Rajnoha
e8383073a9
WHATS_NEW_DM: update 2024-09-05 12:14:42 +02:00
Peter Rajnoha
1e48599193
libdm: do not fail if GETVAL semctl fails for udev sync inc and dec
While performing udev sync semaphore's inc/dec operation, we use the
result from GETVAL semctl just to print a debug message with current
value of that sempahore, nothing else.

If the GETVAL fails for whetever reason while the actual inc/dec
completes successfully, just log a warning message about the GETVAL
(and print the debug messages without the actual semaphore value)
and return success for the inc/dec operation as a whole.
2024-09-05 12:14:42 +02:00
Peter Rajnoha
f7f08ba881
libdm: clean up udev sync semaphore on fail path during its creation
Clean up udev sync semaphore on fail path during its creation, otherwise
the caller will have no handle returned to clean it up itself and the
semaphore will keep staying in the system. The only way to clean it up
would be to call `dmsetup udevcomplete_all` which would destroy all
udev sync semaphores, not just the failed one, which we don't want.
2024-09-05 12:14:42 +02:00
Peter Rajnoha
de196f4b60
libdm: add 'cookie create/inc/dec' log prefix if GETVAL fails for udev sync ops
The same message is printed while performing create/inc/dec operation and
the GETVAL semctl fails. Add a prefix so we know exactly in which of
these functions the issue actually happened.
2024-09-05 12:14:37 +02:00
Marian Csontos
80d7483322 scripts: Fix ConditionPathExists in unit files 2024-09-04 14:40:58 +02:00
Zdenek Kabelac
b7fef5b133 WHATS_NEW: update 2024-08-30 16:51:15 +02:00
Zdenek Kabelac
418fb5a3b4 configure: autoreconf 2024-08-30 16:51:15 +02:00
Zdenek Kabelac
915689f566 make generate 2024-08-30 16:51:15 +02:00
Zdenek Kabelac
a4fa14c73b cleanup: typos in configure.ac 2024-08-30 16:51:15 +02:00