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

19152 Commits

Author SHA1 Message Date
Zdenek Kabelac
95fca3d1d5 makefile: avoid creating shared lib for static only build 2024-04-26 21:37:51 +02:00
Zdenek Kabelac
3fc34ac7ee vdo: fix setting VDO size when stacked
When VDO is used as data LV for thin-pool, we need
to use correct function to propagate this through
the stack of volumes.
2024-04-26 21:37:51 +02:00
David Teigland
21b683614c lvmcache: stop saving duplicate pvs info between scans
In the past it was common for a single command to run
multiple lvmcache_label_scan, and this code was a way
to make each call select the same duplicate pvs.  Now
commands run a single lvmcache_label_scan, so this is
not needed.
2024-04-26 14:13:46 -05:00
Zdenek Kabelac
db96e81f76 tests: wait for raid being in sync 2024-04-26 12:43:03 +02:00
Zdenek Kabelac
d0cfe73326 cov: unused headers 2024-04-26 00:13:34 +02:00
Zdenek Kabelac
57ab219d9b cov: validation
Add internal error for missing vg.
2024-04-26 00:13:34 +02:00
Zdenek Kabelac
c6a37ddca4 toolcontext: check runtime valgrind
When reseting stream buffer - check for being run within valgrind
and only in this case skip this code.
Define VALGRIND_POOL was incorrectly used for this logic.
2024-04-25 21:26:01 +02:00
Zdenek Kabelac
4c5eb2e713 daemon-stray: compile also with VALGRIND_POOL
We can run and build this code just fine with VALGRIND_POOL
and just rely on runtime detection - so we do not close
descriptors also within running valgrind session.
2024-04-25 21:07:36 +02:00
Zdenek Kabelac
4557427a61 spec: require ncurses only for readline
Hopefully editline can go without ncurses dependency.
2024-04-25 17:08:19 +02:00
Zdenek Kabelac
b0c0e8bd7a makefiles: change condition
Old system do not work well with -l% in findstring,
so use a different strategy to recognize whether -lreadline needs
another library (-ltinfo, -lncourses...)
(So we don't need to solve this via 'configure')

Also for now comment out -Wl,-z,pack-relative-relocs and leave it
for the package maintainer whether they want to use.
Possibly add some 'configure' autodetection for usable switch,
as it's relatively new feature..
2024-04-25 17:06:07 +02:00
Zdenek Kabelac
68a8555d69 tests: avoid race check 2024-04-24 13:54:05 +02:00
Zdenek Kabelac
baebd7ca29 tests: accept also closing status 2024-04-24 13:44:58 +02:00
Zdenek Kabelac
b14f29ab5b makefiles: comman escape needs this trick 2024-04-24 13:42:05 +02:00
Zdenek Kabelac
a8009f72bf makefiles: add as-needed only for newer systems
Add some -Wl flags separatly and avoid their duplication.
Also add --as-needed only when system is using 'newer' readline
library - on these older system the usage of '--as-needed'
seems to be causing some hard to solve problem - so avoid it.
2024-04-24 11:35:05 +02:00
Zdenek Kabelac
ba13ac8704 tests: correct linking order for RT_LIBS 2024-04-24 11:34:35 +02:00
Zdenek Kabelac
f569ac59a7 configure: autoreconf 2024-04-24 00:38:32 +02:00
Zdenek Kabelac
078445658c configure.ac: update ldflags args
Attach -Wl,-z,relro,-z,now,-z,pack-relative-relocs,--as-needed
to LDFLAGS, but only if LDFLAGS already doesn't contain 'relro'
(so it's not given repeatedly).

Also start to use -z,now linkage also when building libraries
with default compilation - this avoid calling symbol resolver
while library function are using function needing resolving.

Note: Fedora or RHEL rpm building is using:
CFLAGS=$(rpm --eval %{build_cflags})
LDFLAGS=$(rpm --eval %{build_ldflags})

Also split -DUSE_SD_NOTIFY into DEFS from CFLAGS.
2024-04-24 00:31:26 +02:00
Zdenek Kabelac
f022da9e5f configure.ac: leave LDFLAGS resolving on make time
Use LDFLAGS separately with every use of CLDFLAGS and leave
this flag only for handling versioning.

This will reflect any LDFLAGS setting use during make.
2024-04-24 00:30:05 +02:00
Zdenek Kabelac
5d23054cb3 tests: update dmsecuretest
Look not only for whole 64byte sequence,
but seek also 32byte, 16byte and 8byte parts of the
key.

Currently to pass memcpy ZMM problems add possible
workaround in the form of GLIBC_TUNABLES setting.
2024-04-23 22:06:30 +02:00
Zdenek Kabelac
0b3b40f056 make: generate 2024-04-20 00:03:18 +02:00
Zdenek Kabelac
6caeffa4be tests: look also for 16byte sequences 2024-04-20 00:03:18 +02:00
Zdenek Kabelac
22571fb36a tests: add explicit call to lvs
Avoid using 'lvs' from  'get' shell - as that would wait until
whole group of processes is finished.

TODO: rethink what would be the point of starting 'dmeventd' with lvs.
It seems to break some rules.
2024-04-19 23:56:16 +02:00
Zdenek Kabelac
6ee731ba1a spec: define rhel_version_file for rhel only
Do not define rhel_minor_version on non-rhel systems.
2024-04-19 23:56:16 +02:00
Zdenek Kabelac
79bb9e3172 libdevmapper: _do_event waits for working dmeventd
Refactor _start_daemon and add synchronization delay waiting
untill new forked dmeventd actually open fifos and is ready
to process messages.

This closes some race window in testing.
2024-04-19 23:56:16 +02:00
David Teigland
85b711caae lvmlockd: check for multiple lock managers running
When no lock manager for the global lock had been set yet,
and the first global lock request was received, and both
dlm and sanlock were running, lvmlockd would assume it
should use the dlm for the global lock, and would start
the "lvm_global" dlm lockspace automatically.  That's
not always correct, so don't assume the dlm should be used,
fail the lock request, and wait until a VG with a specific
lock type is started to determine the lock manager to use.
2024-04-19 10:53:37 -05:00
David Teigland
f4911177da lvcreate: allow raidintegrity option with implicit raid type
Allow "lvcreate -m1 --raidintegrity y" when raid1 is used, but
not explicit on the command line.
2024-04-17 13:40:33 -05:00
Zdenek Kabelac
77ff83f784 spec: correct condition
Test needs to make sure that it's either <RHX or <FXX.
However they are set to 0 when on different system.
So use '&&'.
2024-04-16 21:17:42 +02:00
Zdenek Kabelac
b885355e76 tests: add extra dmsetup table
Strange race seems to be occuring here from time to time...
2024-04-16 21:17:42 +02:00
Zdenek Kabelac
2d01af8e56 tests: add another explicit barrier
Just to be sure compiler cannot optimize this out.
2024-04-16 21:17:42 +02:00
Zdenek Kabelac
bb276bf250 tests: update aux for vdo checking
Detect also presence of  'vdoformat' tool.
Fallback to 'kvdo' modprobe only when dm-vdo fails
(removed ugly error message from log)

Also add extra check for scsi model being present
so the test can wait a bit if 'scsi_debug' takes longer time.

No need for 'aux' within aux.
2024-04-16 21:17:42 +02:00
Zdenek Kabelac
93c47a2b94 tests: ensure sscan buffer is nul terminated
Avoid reading past the read buffer when sscanf is used.
2024-04-16 01:11:32 +02:00
Zdenek Kabelac
4ca9d478d4 spec: sanlock 3.7 with version >fc27 and >rh7.4
Decode minor version for rhel.
2024-04-16 01:10:47 +02:00
Zdenek Kabelac
485a1961e8 clang: implicit conversion from 'long' to 'double'
implicit conversion from 'long' to 'double' changes value
from 9223372036854775807 to 9223372036854775808.

So rather compare same integer types.
2024-04-16 01:10:03 +02:00
Zdenek Kabelac
d3d06f8ca0 WHATS_NEW: update 2024-04-15 13:45:11 +02:00
Zdenek Kabelac
569dd5d089 configure: autoreconf 2024-04-15 13:38:44 +02:00
Zdenek Kabelac
3b9bb773fe configure.ac: 3.7.0 is new minimal sanlock versioh
Require this minimal version of sanlock for usage with lvmlockd.
2024-04-15 13:38:44 +02:00
Zdenek Kabelac
716fc27fdd dmeventd: use daemon_close_stray_fds
Use common code for close stray descriptors.
2024-04-15 13:38:44 +02:00
Zdenek Kabelac
79cdfc8ca6 libdaemon: implement daemon_close_stray_fds
Refactor existing code from tools/lvmcmdline.c to
libdaemon/server/daemon-stray.h daemon_close_stray_fds()
used to close stray descriptors above some specified Fd.

This is code parses content of /proc dir to minimize 'blind' closing
of all possible descriptors within rlimits range.

As we have the same code in few other places in it's more 'trivial'
version - these were actually sensitive to high amount of descriptors,
which might be configured on some system.

With this patch we effectively resolve this reported gitlab issue:
https://gitlab.com/lvmteam/lvm2/-/issues/5

TODO: Current placement might not be ideal - however considering
existing code base constrains it's not so simple.
ATM it uses lib/misc/lvm-file.h  for custom_fds declaration
and rest of functinality is included in daemon header file.
2024-04-15 13:38:44 +02:00
Zdenek Kabelac
ecb8399005 lvm: use configure proc dir in lvm.conf
Update some code parts to use configurer /proc from lvm.conf
(so i.e. our testing can use some fake values)
2024-04-15 13:38:44 +02:00
Zdenek Kabelac
84b084c9b6 configure.ac: define DEFAULT_PROC_DIR in one place
Let's move proc into include/configure.h so this define can
be easily used across the source base.

Configure defines it - but ATM we do not provide any configure
option to change it - there should be no need to ever change it.
2024-04-15 13:38:44 +02:00
Zdenek Kabelac
2ea8afba93 dmeventd: typo fix
Fix typo and minor reorder of struct member for better alignment.
2024-04-15 12:58:27 +02:00
David Teigland
f59ec61fa7 lvmcache: fix memleaks on list removal
Free members released from the list.
2024-04-15 12:58:27 +02:00
Zdenek Kabelac
0168de83de spec: disable LTO
Currently there is not much gain in using LTO when building
testing rpms
2024-04-12 01:27:26 +02:00
Zdenek Kabelac
fcfbef26e4 spec: replace exists macro with plain shell test
seems this macro works only with recent rpm.
2024-04-12 01:27:26 +02:00
Zdenek Kabelac
8ce8e33a44 tests: better handling for dmeventd restart
Handle the case, where we  'kill -9' running dmeventd,
and restarting 'dmeventd -R' manages to still contact this
'zombie' damone and manages to get list of monitored devices
out of this and eventually 'run' new and in this case
unexpected instance of dmeventd.
2024-04-12 00:21:46 +02:00
Zdenek Kabelac
aae7c98aaa tests: fallback to normal hostname on older machines
hostname -I  is newer option, add some fallback
2024-04-12 00:21:45 +02:00
Zdenek Kabelac
81dc0e72da tests: explicitely use event_activation=1
Some test do expect event_activation to be set.
So add explicit configuring of this setting in tests,
but also add new default which kind of does it globally
as it's expected default  (yet our testing rpms might
be create with disabled event_activation)
By adding this to each test individually - it's now easy
to locate such tests...
2024-04-12 00:21:45 +02:00
Zdenek Kabelac
d6b15e755e dmeventd: reduce some static variable usage
Move static to main() local vars.

Initilize libdm logging also before starting _restart_dmeventd()
so function there can be also logged.

Move call of _info_dmevent() out of option processing - so some
options like -V are processed with higher priority.
2024-04-12 00:20:43 +02:00
Zdenek Kabelac
5e3224c57d dmeventd: no log when after unlink file is gone
Check for errno ENOENT.

TODO: there should be global wrapper for this...
2024-04-12 00:14:03 +02:00
Zdenek Kabelac
54840d867e devmapper-event: add unlock into init_fifo error path
Unlock server path if there is open failure for client_path
and whole init_fifos() function is returning failure.
2024-04-12 00:14:02 +02:00