From nobody Sat Nov 30 20:12:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Y11SG55tWz5fbjg; Sat, 30 Nov 2024 20:12:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y11SG4XQ0z4Tlf; Sat, 30 Nov 2024 20:12:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732997566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+KY9maGsH6Iv2lmxaiCLKGH2PgGRr4F94P//cTdARgQ=; b=kS0j0dXl+VZNeFIXWUQoCeu4mNFt2WesG37uv4jdu9446dSbKVxuY32lkH7D9uiDi75gKI fbUIXd3YM2azahXvrIJIzOr4l4SUsAV/FGcWnOHMrm/PLyx4sJHvi/XdG3whgLApDnMzRx 8kspTwSOnF5YlLiwAwIitXjMHOZd4MpJ1h5UXLKoOMy1gUt5w7iQifvaWuLhujnGpiQAiC i3UM8yJQvJdlIneJYSayUoeZSDCCvvUTJlWO8pwxYfK6w1+Enqg7edAgKYFSH1NUI3bo5m 6hYk2xRgN/OOtq7+lzBClqABF3iWOorivpCzsJbwe0kFtadT8g91EXJTeoIHMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732997566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+KY9maGsH6Iv2lmxaiCLKGH2PgGRr4F94P//cTdARgQ=; b=O1naOe2ubBFEVUaFlbm5AtPoEXNNBU4j6BTadMPRu9HWryiZqjVznEmoYCLjXEPXmem9+q 2p965Y9H2GpvEojb0TiRP1BPVyeLdUSOhgrxagc5S5Xwp5twFTFeq3RSmCojmoNzUEe7C+ Vpa3C++oO71uIC6suQKzRzAeARUfa5BEJ3aINspN3uhTnzhzqGS2Snaxr1bcfiMYgbN0KB l7EVQ60rL8akA6b/kqZxZ1ownWwzd+kzz/sdUyZdDQ2+MPAUqyX9idiZ3Xlfy613eFp3mc Sp8zqn6Z0PW/m926P8YTWU+0jQ2reG8W9IMfuNYbSpUvGM3C6HlTV2l8XgJfGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732997566; a=rsa-sha256; cv=none; b=trXR6KzFWcBkOsCyTmAN79f406oN9BdEIdZNVY583fQvlW/HGLPcAlWQfEs3FUy3KOv+mV AT0OgUufXdpe/gxxG04idL9Q0ot8NuMyZo/BZgcSCQJt28wFZUNYMdc+RNpB0v2nGBWkq7 UjhPbsH6YqxweQ+SofgLWf8qTBB3OvvfFw8nU9Xh42fHqPkCqyPDxV7+qEs+UvpPKKaIZ4 NB/3OaXBolK+6KqFojhFB4FLiAjKQNyfiBxUFf5hKzxOi1JHat6B1KZqtdHpXBRdbjoSVI TaGsVzSKtTio3lFT1ZE2iY3lrpsDo0pJSpdMYJFUmWPgGNpdk7w6mCRcTyCvTQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Y11SG479szN9J; Sat, 30 Nov 2024 20:12:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4AUKCkN5026586; Sat, 30 Nov 2024 20:12:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AUKCkth026583; Sat, 30 Nov 2024 20:12:46 GMT (envelope-from git) Date: Sat, 30 Nov 2024 20:12:46 GMT Message-Id: <202411302012.4AUKCkth026583@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 9084eb8678d3 - stable/13 - openzfs: Fix GCC 14 warnings List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9084eb8678d3c76f10dd4c7db86897e3f04a222b Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9084eb8678d3c76f10dd4c7db86897e3f04a222b commit 9084eb8678d3c76f10dd4c7db86897e3f04a222b Author: Tony Hutter AuthorDate: 2024-04-29 18:31:50 +0000 Commit: John Baldwin CommitDate: 2024-11-30 19:18:32 +0000 openzfs: Fix GCC 14 warnings This is a direct cherry-pick to stable/13 of OpenZFS commit 4840f023afae7c4932c903cf3a436c02c6704e20: GCC: Fixes for gcc 14 on Fedora 40 - Workaround dangling pointer in uu_list.c (#16124) - Fix calloc() transposed arguments in zpool_vdev_os.c - Make some temp variables unsigned to prevent triggering a '-Werror=alloc-size-larger-than' error. Reviewed-by: Brian Behlendorf Signed-off-by: Tony Hutter Closes #16124 Closes #16125 --- sys/contrib/openzfs/cmd/zpool/os/linux/zpool_vdev_os.c | 2 +- sys/contrib/openzfs/lib/libuutil/uu_list.c | 14 ++++++++++---- sys/contrib/openzfs/module/zfs/vdev_raidz.c | 5 +++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/sys/contrib/openzfs/cmd/zpool/os/linux/zpool_vdev_os.c b/sys/contrib/openzfs/cmd/zpool/os/linux/zpool_vdev_os.c index cfaeef56a20e..42ccd39919bf 100644 --- a/sys/contrib/openzfs/cmd/zpool/os/linux/zpool_vdev_os.c +++ b/sys/contrib/openzfs/cmd/zpool/os/linux/zpool_vdev_os.c @@ -432,7 +432,7 @@ static char *zpool_sysfs_gets(char *path) return (NULL); } - buf = calloc(sizeof (*buf), statbuf.st_size + 1); + buf = calloc(statbuf.st_size + 1, sizeof (*buf)); if (buf == NULL) { close(fd); return (NULL); diff --git a/sys/contrib/openzfs/lib/libuutil/uu_list.c b/sys/contrib/openzfs/lib/libuutil/uu_list.c index c3a447d01de3..0ad5fff6fd4b 100644 --- a/sys/contrib/openzfs/lib/libuutil/uu_list.c +++ b/sys/contrib/openzfs/lib/libuutil/uu_list.c @@ -507,14 +507,20 @@ uu_list_walk(uu_list_t *lp, uu_walk_fn_t *func, void *private, uint32_t flags) } if (lp->ul_debug || robust) { - uu_list_walk_t my_walk; + uu_list_walk_t *my_walk; void *e; - list_walk_init(&my_walk, lp, flags); + my_walk = uu_zalloc(sizeof (*my_walk)); + if (my_walk == NULL) + return (-1); + + list_walk_init(my_walk, lp, flags); while (status == UU_WALK_NEXT && - (e = uu_list_walk_next(&my_walk)) != NULL) + (e = uu_list_walk_next(my_walk)) != NULL) status = (*func)(e, private); - list_walk_fini(&my_walk); + list_walk_fini(my_walk); + + uu_free(my_walk); } else { if (!reverse) { for (np = lp->ul_null_node.uln_next; diff --git a/sys/contrib/openzfs/module/zfs/vdev_raidz.c b/sys/contrib/openzfs/module/zfs/vdev_raidz.c index 5c25007f17b9..ecdaea0bcc51 100644 --- a/sys/contrib/openzfs/module/zfs/vdev_raidz.c +++ b/sys/contrib/openzfs/module/zfs/vdev_raidz.c @@ -1182,8 +1182,9 @@ vdev_raidz_matrix_reconstruct(raidz_row_t *rr, int n, int nmissing, static void vdev_raidz_reconstruct_general(raidz_row_t *rr, int *tgts, int ntgts) { - int n, i, c, t, tt; - int nmissing_rows; + int i, c, t, tt; + unsigned int n; + unsigned int nmissing_rows; int missing_rows[VDEV_RAIDZ_MAXPARITY]; int parity_map[VDEV_RAIDZ_MAXPARITY]; uint8_t *p, *pp;