CI/GCC: Add Fedora 44, fix build errors and threadsappend

- Add Fedora 44 to CI tests
- Fix build issues from the newer compiler. These are mostly 'char *'
  to 'const char *' conversions.
- Fix threadsappend.c test waiting for the same thread TID twice.
  This caused the test to hang on F44 (but strangely not other OSs?)

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #18478
This commit is contained in:
Tony Hutter
2026-05-02 09:57:15 -07:00
parent 65b4a5c551
commit 7534fa4df7
16 changed files with 54 additions and 43 deletions
@@ -88,6 +88,11 @@ case "$OS" in
OSv="fedora-unknown" OSv="fedora-unknown"
URL="https://download.fedoraproject.org/pub/fedora/linux/releases/43/Cloud/x86_64/images/Fedora-Cloud-Base-Generic-43-1.6.x86_64.qcow2" URL="https://download.fedoraproject.org/pub/fedora/linux/releases/43/Cloud/x86_64/images/Fedora-Cloud-Base-Generic-43-1.6.x86_64.qcow2"
;; ;;
fedora44)
OSNAME="Fedora 44"
OSv="fedora-unknown"
URL="https://download.fedoraproject.org/pub/fedora/linux/releases/44/Cloud/x86_64/images/Fedora-Cloud-Base-Generic-44-1.7.x86_64.qcow2"
;;
freebsd13-5r) freebsd13-5r)
FreeBSD="13.5-RELEASE" FreeBSD="13.5-RELEASE"
OSNAME="FreeBSD $FreeBSD" OSNAME="FreeBSD $FreeBSD"
+1 -1
View File
@@ -58,7 +58,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: ['almalinux8', 'almalinux9', 'almalinux10', 'fedora42', 'fedora43'] os: ['almalinux8', 'almalinux9', 'almalinux10', 'fedora42', 'fedora43', 'fedora44']
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
+2 -2
View File
@@ -49,14 +49,14 @@ jobs:
os_selection='["almalinux8", "almalinux9", "almalinux10", "debian12", "fedora42", "freebsd15-0s", "ubuntu24"]' os_selection='["almalinux8", "almalinux9", "almalinux10", "debian12", "fedora42", "freebsd15-0s", "ubuntu24"]'
;; ;;
linux) linux)
os_selection='["almalinux8", "almalinux9", "almalinux10", "centos-stream9", "centos-stream10", "debian11", "debian12", "debian13", "fedora42", "fedora43", "ubuntu22", "ubuntu24"]' os_selection='["almalinux8", "almalinux9", "almalinux10", "centos-stream9", "centos-stream10", "debian11", "debian12", "debian13", "fedora42", "fedora43", "fedora44", "ubuntu22", "ubuntu24"]'
;; ;;
freebsd) freebsd)
os_selection='["freebsd13-5r", "freebsd14-4r", "freebsd13-5s", "freebsd14-4s", "freebsd15-0s", "freebsd16-0c"]' os_selection='["freebsd13-5r", "freebsd14-4r", "freebsd13-5s", "freebsd14-4s", "freebsd15-0s", "freebsd16-0c"]'
;; ;;
*) *)
# default list # default list
os_selection='["almalinux8", "almalinux9", "almalinux10", "centos-stream9", "centos-stream10", "debian12", "debian13", "fedora42", "fedora43", "freebsd14-4r", "freebsd15-0s", "freebsd16-0c", "ubuntu22", "ubuntu24"]' os_selection='["almalinux8", "almalinux9", "almalinux10", "centos-stream9", "centos-stream10", "debian12", "debian13", "fedora42", "fedora43", "fedora44", "freebsd14-4r", "freebsd15-0s", "freebsd16-0c", "ubuntu22", "ubuntu24"]'
;; ;;
esac esac
+1 -1
View File
@@ -238,7 +238,7 @@ _zed_event_value_is_hex(const char *name)
NULL NULL
}; };
const char **pp; const char **pp;
char *p; const char *p;
if (!name) if (!name)
return (0); return (0);
+1 -1
View File
@@ -6928,7 +6928,7 @@ holds_callback(zfs_handle_t *zhp, void *data)
if (cbp->cb_recursive) { if (cbp->cb_recursive) {
const char *snapname; const char *snapname;
char *delim = strchr(zname, '@'); const char *delim = strchr(zname, '@');
if (delim == NULL) if (delim == NULL)
return (0); return (0);
@@ -202,6 +202,7 @@ line_worker(char *line, const char *cachefile)
void **tofree = tofree_all; void **tofree = tofree_all;
char *toktmp; char *toktmp;
const char *toktmp2;
/* BEGIN CSTYLED */ /* BEGIN CSTYLED */
const char *dataset = strtok_r(line, "\t", &toktmp); const char *dataset = strtok_r(line, "\t", &toktmp);
char *p_mountpoint = strtok_r(NULL, "\t", &toktmp); char *p_mountpoint = strtok_r(NULL, "\t", &toktmp);
@@ -226,8 +227,8 @@ line_worker(char *line, const char *cachefile)
/* END CSTYLED */ /* END CSTYLED */
size_t pool_len = strlen(dataset); size_t pool_len = strlen(dataset);
if ((toktmp = strchr(dataset, '/')) != NULL) if ((toktmp2 = strchr(dataset, '/')) != NULL)
pool_len = toktmp - dataset; pool_len = toktmp2 - dataset;
const char *pool = *(tofree++) = strndup(dataset, pool_len); const char *pool = *(tofree++) = strndup(dataset, pool_len);
if (p_nbmand == NULL) { if (p_nbmand == NULL) {
+10 -8
View File
@@ -708,7 +708,7 @@ zfs_open(libzfs_handle_t *hdl, const char *path, int types)
{ {
zfs_handle_t *zhp; zfs_handle_t *zhp;
char errbuf[ERRBUFLEN]; char errbuf[ERRBUFLEN];
char *bookp; const char *bookp;
(void) snprintf(errbuf, sizeof (errbuf), (void) snprintf(errbuf, sizeof (errbuf),
dgettext(TEXT_DOMAIN, "cannot open '%s'"), path); dgettext(TEXT_DOMAIN, "cannot open '%s'"), path);
@@ -3129,7 +3129,7 @@ userquota_propname_decode(const char *propname, boolean_t zoned,
zfs_userquota_prop_t *typep, char *domain, int domainlen, uint64_t *ridp) zfs_userquota_prop_t *typep, char *domain, int domainlen, uint64_t *ridp)
{ {
zfs_userquota_prop_t type; zfs_userquota_prop_t type;
char *cp; const char *cp;
boolean_t isuser; boolean_t isuser;
boolean_t isgroup; boolean_t isgroup;
boolean_t isproject; boolean_t isproject;
@@ -4470,12 +4470,13 @@ zfs_rename(zfs_handle_t *zhp, const char *target, renameflags_t flags)
{ {
int ret = 0; int ret = 0;
zfs_cmd_t zc = {"\0"}; zfs_cmd_t zc = {"\0"};
char *delim;
prop_changelist_t *cl = NULL; prop_changelist_t *cl = NULL;
char parent[ZFS_MAX_DATASET_NAME_LEN]; char parent[ZFS_MAX_DATASET_NAME_LEN];
char property[ZFS_MAXPROPLEN]; char property[ZFS_MAXPROPLEN];
libzfs_handle_t *hdl = zhp->zfs_hdl; libzfs_handle_t *hdl = zhp->zfs_hdl;
char errbuf[ERRBUFLEN]; char errbuf[ERRBUFLEN];
const char *delim;
char *delim2;
/* if we have the same exact name, just return success */ /* if we have the same exact name, just return success */
if (strcmp(zhp->zfs_name, target) == 0) if (strcmp(zhp->zfs_name, target) == 0)
@@ -4500,11 +4501,11 @@ zfs_rename(zfs_handle_t *zhp, const char *target, renameflags_t flags)
*/ */
(void) strlcpy(parent, zhp->zfs_name, (void) strlcpy(parent, zhp->zfs_name,
sizeof (parent)); sizeof (parent));
delim = strchr(parent, '@'); delim2 = strchr(parent, '@');
if (strchr(target, '@') == NULL) if (strchr(target, '@') == NULL)
*(++delim) = '\0'; *(++delim2) = '\0';
else else
*delim = '\0'; *delim2 = '\0';
(void) strlcat(parent, target, sizeof (parent)); (void) strlcat(parent, target, sizeof (parent));
target = parent; target = parent;
} else { } else {
@@ -4525,6 +4526,7 @@ zfs_rename(zfs_handle_t *zhp, const char *target, renameflags_t flags)
if (!zfs_validate_name(hdl, target, zhp->zfs_type, B_TRUE)) if (!zfs_validate_name(hdl, target, zhp->zfs_type, B_TRUE))
return (zfs_error(hdl, EZFS_INVALIDNAME, errbuf)); return (zfs_error(hdl, EZFS_INVALIDNAME, errbuf));
} else { } else {
if (flags.recursive) { if (flags.recursive) {
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"recursive rename must be a snapshot")); "recursive rename must be a snapshot"));
@@ -4580,8 +4582,8 @@ zfs_rename(zfs_handle_t *zhp, const char *target, renameflags_t flags)
} }
if (flags.recursive) { if (flags.recursive) {
char *parentname = zfs_strdup(zhp->zfs_hdl, zhp->zfs_name); char *parentname = zfs_strdup(zhp->zfs_hdl, zhp->zfs_name);
delim = strchr(parentname, '@'); delim2 = strchr(parentname, '@');
*delim = '\0'; *delim2 = '\0';
zfs_handle_t *zhrp = zfs_open(zhp->zfs_hdl, parentname, zfs_handle_t *zhrp = zfs_open(zhp->zfs_hdl, parentname,
ZFS_TYPE_DATASET); ZFS_TYPE_DATASET);
free(parentname); free(parentname);
+2 -2
View File
@@ -550,8 +550,8 @@ get_snapshot_names(differ_info_t *di, const char *fromsnap,
const char *tosnap) const char *tosnap)
{ {
libzfs_handle_t *hdl = di->zhp->zfs_hdl; libzfs_handle_t *hdl = di->zhp->zfs_hdl;
char *atptrf = NULL; const char *atptrf = NULL;
char *atptrt = NULL; const char *atptrt = NULL;
int fdslen, fsnlen; int fdslen, fsnlen;
int tdslen, tsnlen; int tdslen, tsnlen;
+1 -1
View File
@@ -581,7 +581,7 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char *poolname,
prop = zpool_name_to_prop(propname); prop = zpool_name_to_prop(propname);
if (prop == ZPOOL_PROP_INVAL && zpool_prop_feature(propname)) { if (prop == ZPOOL_PROP_INVAL && zpool_prop_feature(propname)) {
int err; int err;
char *fname = strchr(propname, '@') + 1; const char *fname = strchr(propname, '@') + 1;
err = zfeature_lookup_name(fname, NULL); err = zfeature_lookup_name(fname, NULL);
if (err != 0) { if (err != 0) {
+1 -1
View File
@@ -2684,7 +2684,7 @@ zfs_send_one_cb_impl(zfs_handle_t *zhp, const char *from, int fd,
char bookname[ZFS_MAX_DATASET_NAME_LEN]; char bookname[ZFS_MAX_DATASET_NAME_LEN];
nvlist_t *redact_snaps; nvlist_t *redact_snaps;
zfs_handle_t *book_zhp; zfs_handle_t *book_zhp;
char *at, *pound; const char *at, *pound;
int dsnamelen; int dsnamelen;
pound = strchr(redactbook, '#'); pound = strchr(redactbook, '#');
+9 -7
View File
@@ -218,7 +218,8 @@ zfs_get_pci_slots_sys_path(const char *dev_name)
char *address2 = NULL; char *address2 = NULL;
char *path = NULL; char *path = NULL;
char buf[MAXPATHLEN]; char buf[MAXPATHLEN];
char *tmp; const char *tmp;
char *tmp2;
/* If they preface 'dev' with a path (like "/dev") then strip it off */ /* If they preface 'dev' with a path (like "/dev") then strip it off */
tmp = strrchr(dev_name, '/'); tmp = strrchr(dev_name, '/');
@@ -240,9 +241,9 @@ zfs_get_pci_slots_sys_path(const char *dev_name)
* be "0000:01:00.0" while /sys/bus/pci/slots/0/address will be * be "0000:01:00.0" while /sys/bus/pci/slots/0/address will be
* "0000:01:00". Just NULL terminate at the '.' so they match. * "0000:01:00". Just NULL terminate at the '.' so they match.
*/ */
tmp = strrchr(address1, '.'); tmp2 = strrchr(address1, '.');
if (tmp != NULL) if (tmp2 != NULL)
*tmp = '\0'; *tmp2 = '\0';
dp = opendir("/sys/bus/pci/slots/"); dp = opendir("/sys/bus/pci/slots/");
if (dp == NULL) { if (dp == NULL) {
@@ -311,6 +312,7 @@ zfs_get_enclosure_sysfs_path(const char *dev_name)
DIR *dp = NULL; DIR *dp = NULL;
struct dirent *ep; struct dirent *ep;
char buf[MAXPATHLEN]; char buf[MAXPATHLEN];
const char *tmp0;
char *tmp1 = NULL; char *tmp1 = NULL;
char *tmp2 = NULL; char *tmp2 = NULL;
char *tmp3 = NULL; char *tmp3 = NULL;
@@ -322,9 +324,9 @@ zfs_get_enclosure_sysfs_path(const char *dev_name)
return (NULL); return (NULL);
/* If they preface 'dev' with a path (like "/dev") then strip it off */ /* If they preface 'dev' with a path (like "/dev") then strip it off */
tmp1 = strrchr(dev_name, '/'); tmp0 = strrchr(dev_name, '/');
if (tmp1 != NULL) if (tmp0 != NULL)
dev_name = tmp1 + 1; /* +1 since we want the chr after '/' */ dev_name = tmp0 + 1; /* +1 since we want the chr after '/' */
tmpsize = asprintf(&tmp1, "/sys/block/%s/device", dev_name); tmpsize = asprintf(&tmp1, "/sys/block/%s/device", dev_name);
if (tmpsize == -1 || tmp1 == NULL) { if (tmpsize == -1 || tmp1 == NULL) {
+3 -2
View File
@@ -1923,8 +1923,9 @@ nvlist_lookup_nvpair_ei_sep(nvlist_t *nvl, const char *name, const char sep,
{ {
nvpair_t *nvp; nvpair_t *nvp;
const char *np; const char *np;
char *sepp = NULL; const char *sepp = NULL;
char *idxp, *idxep; const char *idxp;
char *idxep;
nvlist_t **nva; nvlist_t **nva;
long idx = 0; long idx = 0;
int n; int n;
+1 -1
View File
@@ -3011,7 +3011,7 @@ dmu_objset_get_user(objset_t *os)
int int
dmu_fsname(const char *snapname, char *buf) dmu_fsname(const char *snapname, char *buf)
{ {
char *atp = strchr(snapname, '@'); const char *atp = strchr(snapname, '@');
if (atp == NULL) if (atp == NULL)
return (SET_ERROR(EINVAL)); return (SET_ERROR(EINVAL));
if (atp - snapname >= ZFS_MAX_DATASET_NAME_LEN) if (atp - snapname >= ZFS_MAX_DATASET_NAME_LEN)
+9 -9
View File
@@ -39,10 +39,10 @@
static int static int
dsl_bookmark_hold_ds(dsl_pool_t *dp, const char *fullname, dsl_bookmark_hold_ds(dsl_pool_t *dp, const char *fullname,
dsl_dataset_t **dsp, const void *tag, char **shortnamep) dsl_dataset_t **dsp, const void *tag, const char **shortnamep)
{ {
char buf[ZFS_MAX_DATASET_NAME_LEN]; char buf[ZFS_MAX_DATASET_NAME_LEN];
char *hashp; const char *hashp;
if (strlen(fullname) >= ZFS_MAX_DATASET_NAME_LEN) if (strlen(fullname) >= ZFS_MAX_DATASET_NAME_LEN)
return (SET_ERROR(ENAMETOOLONG)); return (SET_ERROR(ENAMETOOLONG));
@@ -105,7 +105,7 @@ int
dsl_bookmark_lookup(dsl_pool_t *dp, const char *fullname, dsl_bookmark_lookup(dsl_pool_t *dp, const char *fullname,
dsl_dataset_t *later_ds, zfs_bookmark_phys_t *bmp) dsl_dataset_t *later_ds, zfs_bookmark_phys_t *bmp)
{ {
char *shortname; const char *shortname;
dsl_dataset_t *ds; dsl_dataset_t *ds;
int error; int error;
@@ -219,7 +219,7 @@ dsl_bookmark_create_check_impl(dsl_pool_t *dp,
int error; int error;
dsl_dataset_t *newbm_ds; dsl_dataset_t *newbm_ds;
char *newbm_short; const char *newbm_short;
zfs_bookmark_phys_t bmark_phys; zfs_bookmark_phys_t bmark_phys;
error = dsl_bookmark_hold_ds(dp, newbm, &newbm_ds, FTAG, &newbm_short); error = dsl_bookmark_hold_ds(dp, newbm, &newbm_ds, FTAG, &newbm_short);
@@ -329,7 +329,7 @@ dsl_bookmark_create_check(void *arg, dmu_tx_t *tx)
} }
static dsl_bookmark_node_t * static dsl_bookmark_node_t *
dsl_bookmark_node_alloc(char *shortname) dsl_bookmark_node_alloc(const char *shortname)
{ {
dsl_bookmark_node_t *dbn = kmem_alloc(sizeof (*dbn), KM_SLEEP); dsl_bookmark_node_t *dbn = kmem_alloc(sizeof (*dbn), KM_SLEEP);
dbn->dbn_name = spa_strdup(shortname); dbn->dbn_name = spa_strdup(shortname);
@@ -445,7 +445,7 @@ dsl_bookmark_create_sync_impl_snap(const char *bookmark, const char *snapshot,
dsl_pool_t *dp = dmu_tx_pool(tx); dsl_pool_t *dp = dmu_tx_pool(tx);
objset_t *mos = dp->dp_meta_objset; objset_t *mos = dp->dp_meta_objset;
dsl_dataset_t *snapds, *bmark_fs; dsl_dataset_t *snapds, *bmark_fs;
char *shortname; const char *shortname;
boolean_t bookmark_redacted; boolean_t bookmark_redacted;
uint64_t *dsredactsnaps; uint64_t *dsredactsnaps;
uint64_t dsnumsnaps; uint64_t dsnumsnaps;
@@ -535,7 +535,7 @@ dsl_bookmark_create_sync_impl_book(
{ {
dsl_pool_t *dp = dmu_tx_pool(tx); dsl_pool_t *dp = dmu_tx_pool(tx);
dsl_dataset_t *bmark_fs_source, *bmark_fs_new; dsl_dataset_t *bmark_fs_source, *bmark_fs_new;
char *source_shortname, *new_shortname; const char *source_shortname, *new_shortname;
zfs_bookmark_phys_t source_phys; zfs_bookmark_phys_t source_phys;
VERIFY0(dsl_bookmark_hold_ds(dp, source_name, &bmark_fs_source, FTAG, VERIFY0(dsl_bookmark_hold_ds(dp, source_name, &bmark_fs_source, FTAG,
@@ -1106,7 +1106,7 @@ dsl_bookmark_destroy_check(void *arg, dmu_tx_t *tx)
dsl_dataset_t *ds; dsl_dataset_t *ds;
zfs_bookmark_phys_t bm; zfs_bookmark_phys_t bm;
int error; int error;
char *shortname; const char *shortname;
error = dsl_bookmark_hold_ds(dp, fullname, &ds, error = dsl_bookmark_hold_ds(dp, fullname, &ds,
FTAG, &shortname); FTAG, &shortname);
@@ -1162,7 +1162,7 @@ dsl_bookmark_destroy_sync(void *arg, dmu_tx_t *tx)
for (nvpair_t *pair = nvlist_next_nvpair(dbda->dbda_success, NULL); for (nvpair_t *pair = nvlist_next_nvpair(dbda->dbda_success, NULL);
pair != NULL; pair = nvlist_next_nvpair(dbda->dbda_success, pair)) { pair != NULL; pair = nvlist_next_nvpair(dbda->dbda_success, pair)) {
dsl_dataset_t *ds; dsl_dataset_t *ds;
char *shortname; const char *shortname;
uint64_t zap_cnt; uint64_t zap_cnt;
VERIFY0(dsl_bookmark_hold_ds(dp, nvpair_name(pair), VERIFY0(dsl_bookmark_hold_ds(dp, nvpair_name(pair),
+1 -1
View File
@@ -417,7 +417,7 @@ dsl_dir_namelen(dsl_dir_t *dd)
static int static int
getcomponent(const char *path, char *component, const char **nextp) getcomponent(const char *path, char *component, const char **nextp)
{ {
char *p; const char *p;
if ((path == NULL) || (path[0] == '\0')) if ((path == NULL) || (path[0] == '\0'))
return (SET_ERROR(ENOENT)); return (SET_ERROR(ENOENT));
+4 -4
View File
@@ -87,7 +87,7 @@ usage(void)
int int
main(int argc, char **argv) main(int argc, char **argv)
{ {
pthread_t tid; pthread_t tid[2];
int ret = 0; int ret = 0;
long ncpus = 0; long ncpus = 0;
int i; int i;
@@ -120,7 +120,7 @@ main(int argc, char **argv)
} }
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
ret = pthread_create(&tid, NULL, go, (void *)&i); ret = pthread_create(&tid[i], NULL, go, (void *)&i);
if (ret != 0) { if (ret != 0) {
(void) fprintf(stderr, (void) fprintf(stderr,
"zfs_threadsappend: thr_create(#%d) " "zfs_threadsappend: thr_create(#%d) "
@@ -129,8 +129,8 @@ main(int argc, char **argv)
} }
} }
while (pthread_join(tid, NULL) == 0) for (i = 0; i < 2; i++)
continue; (void) pthread_join(tid[i], NULL);
return (0); return (0);
} }