From nobody Wed Oct 25 15:26:46 2023 X-Original-To: dev-commits-src-branches@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 4SFt7q2160z4xfJv; Wed, 25 Oct 2023 15:26:47 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SFt7q1QHTz4TlM; Wed, 25 Oct 2023 15:26:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698247607; 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=WYMwRMfKulsufGGqpuX5bhQxW4nPcZ0UM+HqOHnjHfY=; b=H4xFvaOZYguIMK1fggqc5/AtiMOogvV4AuLqTDMbEDmG3Hi2yhwb9RHKZLcqwF/Tfce3BP tiiDrACxs8yqAOdizR1JZZ7RYj6colw2pWpmh8ftxrzejAywBq5Nbmi95ntRO36vxp7K0a 5+f2v5pYlqkYe2Jd8v6RMWG3wgLmgvu1DMp0cc3pC8sEnmDOBSf1dzc50oyVV/TjpvmMKS 9FG20rXkTjopMz+5W6SyddvTEsYWjnuGxmcnttiVLOc1BH3k4SHP8i3YSK2/xdBTYuB5Im yrVKcyBj91b152NtBHhsu9pN97UpZaObAhxjfFBtS8RBSBexnBIV98jCS9hVaw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698247607; a=rsa-sha256; cv=none; b=tuATsj+c2a+8DlDfJNU9TUXIwf3EIpFTaTSWo+7wN2BSqxuLqTahGNfbj6Z+eD5C6IaJqT pPtcepon16+nTMbXHmG4z14Qp0j4RDAUj2IDLi8UiArioIyh7vbbpPa1eAYeJ1hWXnqzm2 EngU06Qz3mkokgOCE7QOJeg1xuX492YGztv0InPRv+jbfW3PuaB1qVbhSILXAeuBTO8LxN N0v/7PPIuf+Twi//lEwu0+y8YN/pu4EqPPvjUbplNgwLwEKUT+PeQn//IR46BaHkK8HZrE Pssxe9oUd/QQ/ECr4MU1ujZk2k/L2Fd8DbrJ1FcMY6/Uu64dQ4p3a/EUEW60HQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698247607; 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=WYMwRMfKulsufGGqpuX5bhQxW4nPcZ0UM+HqOHnjHfY=; b=JMGhG31YruBNYHYQTqKVZ3ubjDe+BWyPqagCK1qNt+V5QUvJ5oAhi6DFOHwXsEFbtfgq3A X9gHV+WW715cZLOcpVEIGSxqCAhez4WRcw27s5o5YgXYVJZWea6idAhf3p7CJwTMrbWi2C L8e8UlYy2cpmOsX8GhcVO3mDGUhSdYz6aa8aSDtweao+zVC1NTyRpAK7GWQGAOR19+fjv8 dvTw2LtcG34OsX8I0kl4+FL6VdyIjctjXHMw3m/tYP0CXJqomAf02c0FnFRQ9+1tyavzp8 YAgnogxSbrvcEzP2P91jVz4S+m0tNVcq/QWTTaY2xnwkUJq9irJqQeaQaATIUg== 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 4SFt7p71hpz18wS; Wed, 25 Oct 2023 15:26:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 39PFQkQj072901; Wed, 25 Oct 2023 15:26:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39PFQkYJ072898; Wed, 25 Oct 2023 15:26:46 GMT (envelope-from git) Date: Wed, 25 Oct 2023 15:26:46 GMT Message-Id: <202310251526.39PFQkYJ072898@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 8ec7d748c503 - stable/14 - makefs/zfs: fix build with gcc 12 after b5a2bf512dbe List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8ec7d748c5033fef8b023ae3d2cfed439d230aef Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8ec7d748c5033fef8b023ae3d2cfed439d230aef commit 8ec7d748c5033fef8b023ae3d2cfed439d230aef Author: Dimitry Andric AuthorDate: 2023-09-30 18:27:20 +0000 Commit: Mark Johnston CommitDate: 2023-10-25 15:24:49 +0000 makefs/zfs: fix build with gcc 12 after b5a2bf512dbe Due to integer promotion rules, dn_nlevels (uint8_t) gets promoted to a plain int, resulting in -Werror warnings with gcc 12: In file included from /workspace/src/usr.sbin/makefs/zfs.c:35: /workspace/src/usr.sbin/makefs/zfs.c: In function '_dnode_cursor_flush': /workspace/src/usr.sbin/makefs/zfs.c:684:23: error: comparison of integer expressions of different signedness: 'unsigned int' and 'int' [-Werror=sign-compare] 684 | assert(levels <= c->dnode->dn_nlevels - 1); | ^~ /workspace/src/usr.sbin/makefs/zfs.c:691:27: error: comparison of integer expressions of different signedness: 'unsigned int' and 'int' [-Werror=sign-compare] 691 | if (level == c->dnode->dn_nlevels - 1) { | ^~ /workspace/src/usr.sbin/makefs/zfs.c: In function 'dnode_cursor_next': /workspace/src/usr.sbin/makefs/zfs.c:739:41: error: comparison of integer expressions of different signedness: 'unsigned int' and 'int' [-Werror=sign-compare] 739 | for (levels = 0; levels < c->dnode->dn_nlevels - 1; levels++) { | ^ Fix it by subtracting 1U instead of 1. Fixes: b5a2bf512dbe MFC after: 3 days (cherry picked from commit 8a77bc5e1be1a999f2f8d9df0c01fe01fb5a0787) --- usr.sbin/makefs/zfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/makefs/zfs.c b/usr.sbin/makefs/zfs.c index db302fe1e760..b16a48564f04 100644 --- a/usr.sbin/makefs/zfs.c +++ b/usr.sbin/makefs/zfs.c @@ -681,14 +681,14 @@ _dnode_cursor_flush(zfs_opt_t *zfs, struct dnode_cursor *c, unsigned int levels) off_t blkid, blksz, loc; assert(levels > 0); - assert(levels <= c->dnode->dn_nlevels - 1); + assert(levels <= c->dnode->dn_nlevels - 1U); blksz = MAXBLOCKSIZE; blkid = (c->dataoff / c->datablksz) / BLKPTR_PER_INDIR; for (unsigned int level = 1; level <= levels; level++) { buf = c->inddir[level - 1]; - if (level == c->dnode->dn_nlevels - 1) { + if (level == c->dnode->dn_nlevels - 1U) { pbp = &c->dnode->dn_blkptr[0]; } else { uint64_t iblkid; @@ -736,7 +736,7 @@ dnode_cursor_next(zfs_opt_t *zfs, struct dnode_cursor *c, off_t off) /* Do we need to flush any full indirect blocks? */ if (off > 0) { blkid = off / c->datablksz; - for (levels = 0; levels < c->dnode->dn_nlevels - 1; levels++) { + for (levels = 0; levels < c->dnode->dn_nlevels - 1U; levels++) { if (blkid % BLKPTR_PER_INDIR != 0) break; blkid /= BLKPTR_PER_INDIR;