Skip to content

Commit 547788f

Browse files
committed
Merge branch 'stable-0.10.y' into sles15-sp7
2 parents 04c3a0a + 4546a60 commit 547788f

21 files changed

Lines changed: 216 additions & 71 deletions

File tree

.github/actions/spelling/expect.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ alloc
66
alltgpt
77
alua
88
aptpl
9+
ASAN
910
ascq
1011
ata
1112
autoconfig
@@ -14,6 +15,7 @@ autoresize
1415
backported
1516
barbie
1617
BINDIR
18+
bitfield
1719
blkid
1820
bmarzins
1921
Bsymbolic
@@ -50,6 +52,7 @@ DIO
5052
directio
5153
disablequeueing
5254
dmevent
55+
dmi
5356
dmmp
5457
dmraid
5558
dmsetup
@@ -59,12 +62,14 @@ ECKD
5962
emc
6063
Engenio
6164
EVPD
65+
Exos
6266
failback
6367
failover
6468
fds
6569
fexceptions
6670
FFFFFFFF
6771
fge
72+
fno
6873
followover
6974
forcequeueing
7075
fpin
@@ -76,6 +81,7 @@ getrlimit
7681
getuid
7782
github
7883
gitlab
84+
google
7985
GPT
8086
hbtl
8187
hds
@@ -121,6 +127,7 @@ libudevdir
121127
liburcu
122128
linux
123129
LIO
130+
lld
124131
lpthread
125132
Lun
126133
lvm
@@ -140,12 +147,13 @@ multipathing
140147
multipaths
141148
multiqueue
142149
mwilck
150+
NFINIDAT
143151
NOLOG
144152
nompath
145153
NOSCAN
146154
Nosync
147155
nvme
148-
NFINIDAT
156+
Nytro
149157
OBJDEPS
150158
oneshot
151159
ontap
@@ -155,8 +163,10 @@ OPTFLAGS
155163
paramp
156164
partx
157165
pathgroup
166+
pathlist
158167
petabytes
159168
pgpolicy
169+
pgvec
160170
plugindir
161171
PNR
162172
ppc
@@ -191,12 +201,12 @@ rpmbuild
191201
rport
192202
rtpi
193203
rtprio
204+
sanitizers
194205
sas
195206
sbp
196207
scsi
197208
SCST
198209
sda
199-
sdc
200210
Seagate
201211
setmarginal
202212
setprkey
@@ -251,6 +261,7 @@ usr
251261
uuid
252262
valgrind
253263
varoqui
264+
versioning
254265
Vess
255266
vgr
256267
VNX
@@ -261,6 +272,7 @@ weightedpath
261272
wholedisk
262273
Wilck
263274
wildcards
275+
Wno
264276
workflows
265277
wrt
266278
wwid

Makefile.inc

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
# Uncomment to disable dmevents polling support
1010
# ENABLE_DMEVENTS_POLL = 0
1111
#
12+
# Use ASAN=1 on make command line to enable address sanitizer
13+
ASAN :=
14+
#
15+
# Override on make command line if desired
16+
OPT := -O2
17+
1218
# Readline library to use, libedit, libreadline, or empty
1319
# Caution: Using libreadline may make the multipathd binary undistributable,
1420
# see https://github.com/opensvc/multipath-tools/issues/36
@@ -99,7 +105,7 @@ SYSTEMD_LIBDEPS := $(if $(SYSTEMD),$(if $(shell test $(SYSTEMD) -gt 209 && echo
99105
MODPROBE_UNIT := $(shell test "0$(SYSTEMD)" -lt 245 2>/dev/null || \
100106
echo "modprobe@dm_multipath.service")
101107

102-
OPTFLAGS := -O2 -g $(STACKPROT) --param=ssp-buffer-size=4
108+
OPTFLAGS := $(OPT) -g $(STACKPROT) --param=ssp-buffer-size=4
103109

104110
# Set WARN_ONLY=1 to avoid compilation erroring out due to warnings. Useful during development.
105111
WARN_ONLY :=
@@ -109,18 +115,18 @@ WARNFLAGS := $(WERROR) -Wall -Wextra -Wformat=2 $(WFORMATOVERFLOW) -W$(ERROR)imp
109115
-W$(ERROR)implicit-function-declaration -W$(ERROR)format-security \
110116
$(WNOCLOBBERED) -W$(ERROR)cast-qual $(ERROR_DISCARDED_QUALIFIERS) $(W_URCU_TYPE_LIMITS)
111117

112-
CPPFLAGS := $(FORTIFY_OPT) $(CPPFLAGS) $(D_URCU_VERSION) \
118+
CPPFLAGS := $(FORTIFY_OPT) $(CPPFLAGS) $(D_URCU_VERSION) $(D_CMOCKA_VERSION) \
113119
-D_FILE_OFFSET_BITS=64 \
114120
-DBIN_DIR=\"$(bindir)\" -DMULTIPATH_DIR=\"$(TGTDIR)$(plugindir)\" \
115121
-DRUNTIME_DIR=\"$(runtimedir)\" -DCONFIG_DIR=\"$(TGTDIR)$(configdir)\" \
116122
-DDEFAULT_CONFIGFILE=\"$(TGTDIR)$(configfile)\" -DSTATE_DIR=\"$(TGTDIR)$(statedir)\" \
117123
-DEXTRAVERSION=\"$(EXTRAVERSION)\" -MMD -MP
118124
CFLAGS := -std=$(C_STD) $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe \
119-
-fexceptions
125+
-fexceptions -fno-strict-aliasing $(if $(ASAN),-fsanitize=address)
120126
BIN_CFLAGS := -fPIE -DPIE
121127
LIB_CFLAGS := -fPIC
122128
SHARED_FLAGS := -shared
123-
LDFLAGS := $(LDFLAGS) -Wl,-z,relro -Wl,-z,now -Wl,-z,defs
129+
LDFLAGS := $(LDFLAGS) -Wl,-z,relro -Wl,-z,now -Wl,-z,defs $(if $(ASAN),-lasan)
124130
BIN_LDFLAGS := -pie
125131

126132
# Source code directories. Don't modify.

NEWS.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,42 @@
11
# multipath-tools Release Notes
22

3+
## multipath-tools 0.10.6, 2026/01
4+
5+
**Note:** This release includes a minor change of the libmultipath ABI.
6+
7+
### Bug fixes
8+
9+
* Fix `mpathpersist --report-capabilities` output. Fixes 0.5.0.
10+
* Fix command descriptions in the multipathd man page. Fixes 0.9.2.
11+
* Fix an undefined symbol error with the LLVM lld linker.
12+
Fixes [#132](https://github.com/opensvc/multipath-tools/issues/132), 0.10.0.
13+
* Fix ISO C23 compatibility issue causing errors with new compilers.
14+
* Fix memory leak caused by not joining the "init unwinder" thread.
15+
Fixes 0.8.6.
16+
* Fix memory leaks in kpartx. Fixes any version.
17+
* Print the warning "setting scsi timeouts is unsupported for protocol" only
18+
once per protocol. Fixes 0.9.0.
19+
* Make sure multipath-tools is compiled with the compiler flag
20+
`-fno-strict-aliasing`. This turns out to be necessary because our code
21+
uses techniques like `container_of()` which don't work well with
22+
strict aliasing rules.
23+
Fixes [#130](https://github.com/opensvc/multipath-tools/issues/130).
24+
* Fix initialization of paths that were offline during path detection.
25+
* Fix printing the "path offline" log message for offline paths that don't
26+
have a path checker configured.
27+
* kpartx: Fix freeing static buffer when operating on regular files.
28+
Fixes [#139](https://github.com/opensvc/multipath-tools/issues/139).
29+
30+
### Other changes
31+
32+
* Hardware table: add Seagate Exos and Nytro series.
33+
* Avoid joining threads twice with liburcu 0.14.0 and newer.
34+
* CI updates (GitHub workflows).
35+
* Fix CI for cmocka 2.0 by adding the `-Wno-error=deprecated-declarations`
36+
compiler flag.
37+
Fixes [#129](https://github.com/opensvc/multipath-tools/issues/129)
38+
* Add the ASAN=1 and OPT= make variables (see README.md).
39+
340
## multipath-tools 0.10.5, 2025/10
441

542
### Other changes

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ See "Passing standard compiler flags" below for an exception.
7878
The following variables can be passed to the `make` command line:
7979

8080
* `V=1`: enable verbose build.
81+
* `OPT=`: set optimization flags. You may want to set `OPT="-O0"` for
82+
debugging, for example. The default is `-O2`. Note that it is also
83+
possible to set `OPTFLAGS`, which takes precedence over `OPT`. `OPTFLAGS`
84+
sets additional options by default, which are intended for distribution
85+
build environments to override. For quick customization of the optimization
86+
level, use `OPT`.
87+
* `ASAN=1`: Enable
88+
[AddressSanitizer](https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer)
89+
during build for debugging memory allocation. This is off by default.
8190
* `plugindir="/some/path"`: directory where libmultipath plugins (path
8291
checkers, prioritizers, and foreign multipath support) will be looked up.
8392
This used to be the run-time option `multipath_dir` in earlier versions.

create-config.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ URCU_VERSION = $(shell \
7777
$(PKG_CONFIG) --modversion liburcu 2>/dev/null | \
7878
awk -F. '{ printf("-DURCU_VERSION=0x%06x", 256 * ( 256 * $$1 + $$2) + $$3); }')
7979

80+
CMOCKA_VERSION = $(shell \
81+
($(PKG_CONFIG) --modversion cmocka 2>/dev/null || echo "1.1.0" ) | \
82+
awk -F. '{ printf("%d", 256 * ( 256 * $$1 + $$2) + $$3); }')
83+
8084
DEFINES :=
8185

8286
ifneq ($(call check_func,dm_task_no_flush,$(devmapper_incdir)/libdevmapper.h),0)
@@ -185,6 +189,7 @@ $(TOPDIR)/config.mk: $(multipathdir)/autoconfig.h
185189
@echo "FPIN_SUPPORT := $(FPIN_SUPPORT)" >$@
186190
@echo "FORTIFY_OPT := $(FORTIFY_OPT)" >>$@
187191
@echo "D_URCU_VERSION := $(call URCU_VERSION)" >>$@
192+
@echo "CMOCKA_VERSION := $(call CMOCKA_VERSION)" >>$@
188193
@echo "SYSTEMD := $(SYSTEMD)" >>$@
189194
@echo "ANA_SUPPORT := $(ANA_SUPPORT)" >>$@
190195
@echo "STACKPROT := $(call TEST_CC_OPTION,-fstack-protector-strong,-fstack-protector)" >>$@

kpartx/devmapper.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
* Copyright (c) 2004, 2005 Christophe Varoqui
33
*/
4+
#define _GNU_SOURCE
45
#include <stdio.h>
56
#include <stdlib.h>
67
#include <string.h>
@@ -699,14 +700,13 @@ int dm_find_part(const char *parent, const char *delim, int part,
699700

700701
char *nondm_create_uuid(dev_t devt)
701702
{
702-
#define NONDM_UUID_BUFLEN (34 + sizeof(NONDM_UUID_PREFIX) + \
703-
sizeof(NONDM_UUID_SUFFIX))
704-
static char uuid_buf[NONDM_UUID_BUFLEN];
705-
snprintf(uuid_buf, sizeof(uuid_buf), "%s_%u:%u_%s",
706-
NONDM_UUID_PREFIX, major(devt), minor(devt),
707-
NONDM_UUID_SUFFIX);
708-
uuid_buf[NONDM_UUID_BUFLEN-1] = '\0';
709-
return uuid_buf;
703+
char *uuid;
704+
705+
if (asprintf(&uuid, "%s_%u:%u_%s", NONDM_UUID_PREFIX, major(devt),
706+
minor(devt), NONDM_UUID_SUFFIX) >= 0)
707+
return uuid;
708+
else
709+
return NULL;
710710
}
711711

712712
int nondm_parse_uuid(const char *uuid, unsigned int *major, unsigned int *minor)

kpartx/kpartx.c

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,11 @@ xmalloc (size_t size) {
227227
return t;
228228
}
229229

230+
static void cleanup_charp(char **p)
231+
{
232+
free(*p);
233+
}
234+
230235
int
231236
main(int argc, char **argv){
232237
int i, j, m, n, op, off, arg, c, d, ro=0;
@@ -237,10 +242,11 @@ main(int argc, char **argv){
237242
char *type, *diskdevice, *device, *progname;
238243
int verbose = 0;
239244
char partname[PARTNAME_SIZE], params[PARTNAME_SIZE + 16];
240-
char * loopdev = NULL;
241-
char * delim = NULL;
242-
char *uuid = NULL;
243-
char *mapname = NULL;
245+
char *loopdev __attribute__((cleanup(cleanup_charp))) = NULL;
246+
char *delim __attribute__((cleanup(cleanup_charp))) = NULL;
247+
char *uuid __attribute__((cleanup(cleanup_charp))) = NULL;
248+
char *_mapname __attribute__((cleanup(cleanup_charp))) = NULL;
249+
char *mapname;
244250
int hotplug = 0;
245251
int loopcreated = 0;
246252
struct stat buf;
@@ -292,7 +298,9 @@ main(int argc, char **argv){
292298
verbose = 1;
293299
break;
294300
case 'p':
295-
delim = optarg;
301+
delim = strdup(optarg);
302+
if (!delim)
303+
exit(1);
296304
break;
297305
case 'l':
298306
what = LIST;
@@ -381,22 +389,26 @@ main(int argc, char **argv){
381389
off = find_devname_offset(device);
382390

383391
if (!loopdev) {
384-
mapname = dm_mapname(major(buf.st_rdev), minor(buf.st_rdev));
385-
if (mapname)
386-
uuid = dm_mapuuid(mapname);
392+
_mapname = dm_mapname(major(buf.st_rdev), minor(buf.st_rdev));
393+
if (_mapname)
394+
uuid = dm_mapuuid(_mapname);
387395
}
388396

397+
mapname = _mapname;
398+
if (!mapname)
399+
mapname = device + off;
400+
389401
/*
390402
* We are called for a non-DM device.
391403
* Make up a fake UUID for the device, unless "-d -f" is given.
392404
* This allows deletion of partitions created with older kpartx
393405
* versions which didn't use the fake UUID during creation.
394406
*/
395-
if (!uuid && !(what == DELETE && force_devmap))
407+
if (!uuid && !(what == DELETE && force_devmap)) {
396408
uuid = nondm_create_uuid(buf.st_rdev);
397-
398-
if (!mapname)
399-
mapname = device + off;
409+
if (!uuid)
410+
exit(1);
411+
}
400412

401413
if (delim == NULL) {
402414
delim = xmalloc(DELIM_SIZE);
@@ -674,7 +686,6 @@ main(int argc, char **argv){
674686
if (verbose)
675687
fprintf(stderr, "loop deleted : %s\n", device);
676688
}
677-
678689
end:
679690
dm_lib_exit();
680691

libmpathutil/parser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ snprint_keyword(struct strbuf *buff, const char *fmt, struct keyword *kw,
153153
const void *data)
154154
{
155155
int r = 0;
156-
char *f;
156+
const char *f;
157157
struct config *conf;
158158
STRBUF_ON_STACK(sbuf);
159159

libmpathutil/util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ strchop(char *str)
3838
*/
3939
const char *libmp_basename(const char *filename)
4040
{
41-
char *p = strrchr(filename, '/');
41+
const char *p = strrchr(filename, '/');
4242
return p ? p + 1 : filename;
4343
}
4444

libmultipath/discovery.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,8 @@ scsi_tmo_error_msg(struct path *pp)
879879
STRBUF_ON_STACK(proto_buf);
880880
unsigned int proto_id = bus_protocol_id(pp);
881881

882+
if (is_bit_set_in_bitfield(proto_id, bf))
883+
return;
882884
snprint_path_protocol(&proto_buf, pp);
883885
condlog(2, "%s: setting scsi timeouts is unsupported for protocol %s",
884886
pp->dev, get_strbuf_str(&proto_buf));

0 commit comments

Comments
 (0)