From nobody Thu Jan 29 00:03:27 2026 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 4f1fVl6qZlz6QPWn for ; Thu, 29 Jan 2026 00:03:27 +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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f1fVl2Y13z3Gll for ; Thu, 29 Jan 2026 00:03:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769645007; 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=xc1gL1K+06S5KviplUZm1+aDVuDMOT2tauv49ptP65Q=; b=C6wUK78L9cOPGIQcxZWJshHCMGQlg35O/w674p2C/xV/0rbuFKUdZlOadfJyw+Hv9BCh/3 ba6K0578rfEHxSQWZ7bwvDczwLygO/qqoaIRaDZoBqKWfTekP/xl6ujFXSAtK6BAA3SirG fRPYBqQ+bizC5xg742D/qY9ACDP/kE+wLuACBI1RNpNgsCa+lRQKc60tL6Rs+E0/OCeHZ9 wuzAwplGRfkOhBMFWZx36BUCFgIgulFrUgziFEsM1o/Mr7xkhpQwKL+KykFjApnD5q7dIB biKBMe+HQRc26ybFu+QfuInzdTsVqE1Wh5bUTGXIeZwftZW8yPysGCGySA5uRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769645007; 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=xc1gL1K+06S5KviplUZm1+aDVuDMOT2tauv49ptP65Q=; b=GfVefprLsbweXEJatd7e23Wk4hXurkqElbkQn7B+w4zGhX+IponkVQ2dypjdqA1PmBqZhN QDK757HPUWyA9FfQ4zfmbY0pbHc84wfFjby1ZPLH/xgSpxuW5+fzXP++/Cf7OWK4igPqtq ExsMth/V1nQuwX4Y7KyyOiMU079N0NRNFGYUTIHyo7zsIpcTw1N7e0np1jEAM2+ExF5UhQ ukQqcm+p71SHZOftclPJrDVR3uegfHrSXKOlCmSmQT3nZQnUM6wFYTyHOvrSgpezC6D0pW hKMDddybn7AwqQLZAC/3Nl9D5HN8sOPU7e7AH6dWFjSa3mOpQUH4LDtMRnChoA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1769645007; a=rsa-sha256; cv=none; b=xyAKgp7ViHo6zulem/qmOQAZ/ti2zv2G1/f/2oPWls2bDIODNSQEwdvWD95u9KX7PJYbD8 g2joqXyXvrlzzsOF82FwmjiPtla47+CUIRT83hOcydOv5KwyduwIQxgZ6UTJk1USLrSwqG oy6cPA1JzlSxQNrmyF8Dcc0y7PJ1W9w3KjBwE0eNSYM2uJt2WuIkgTwD0XZzsr8vaW9/7h YaxbxkTVBstieg7Z9LYU5mPLIAgDYvM5SLIS/NMc83lfhMbZPIQ+9842nL7veQz56MQZ7v 74axiUo8LjMEG6CL5Sw8inUkCD4Vrm8FeWJZkCzLtOlHot85V0YFPDyXs4RTdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f1fVl1wS7zJ0 for ; Thu, 29 Jan 2026 00:03:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id da05 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 29 Jan 2026 00:03:27 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 2d8562860eca - stable/14 - ctl: Avoid an upcast for calling ctl_scsi_path_string 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: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/14 X-Git-Reftype: branch X-Git-Commit: 2d8562860eca7eff835ca71e2fdde073e2df806b Auto-Submitted: auto-generated Date: Thu, 29 Jan 2026 00:03:27 +0000 Message-Id: <697aa3cf.da05.13772b3e@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2d8562860eca7eff835ca71e2fdde073e2df806b commit 2d8562860eca7eff835ca71e2fdde073e2df806b Author: John Baldwin AuthorDate: 2024-05-02 23:30:20 +0000 Commit: John Baldwin CommitDate: 2026-01-29 00:01:15 +0000 ctl: Avoid an upcast for calling ctl_scsi_path_string Change the first argument of ctl_scsi_path_string to be the embedded header structure instead of the union. Currently union ctl_io and struct ctl_scsiio have the same alignment, but this changes on i386 if a new union member is added that contains a uint64_t member (such as an embedded struct nvme_command for NVMeoF). In that case, union ctl_io requires stronger alignment, so the upcast from struct ctl_scsiio to union ctl_io in ctl_scsi_sense_sbuf raises an increasing alignment warning on i386. Avoid the warning by passing struct ctl_io_hdr as the first argument to ctl_scsi_path_string instead. Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44716 (cherry picked from commit 352cf4a64adf117a8a0cf23a20b8de4990b2ba22) --- sys/cam/ctl/ctl.c | 2 +- sys/cam/ctl/ctl_scsi_all.c | 8 ++++---- sys/cam/ctl/ctl_scsi_all.h | 2 +- sys/cam/ctl/ctl_util.c | 6 +++--- usr.sbin/ctladm/ctladm.c | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index b60a63e66032..7f703b42e0b3 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -13031,7 +13031,7 @@ ctl_process_done(union ctl_io *io) char path_str[64]; struct sbuf sb; - ctl_scsi_path_string(io, path_str, sizeof(path_str)); + ctl_scsi_path_string(&io->io_hdr, path_str, sizeof(path_str)); sbuf_new(&sb, str, sizeof(str), SBUF_FIXEDLEN); ctl_io_sbuf(io, &sb); diff --git a/sys/cam/ctl/ctl_scsi_all.c b/sys/cam/ctl/ctl_scsi_all.c index d712377e3389..0de1694823bf 100644 --- a/sys/cam/ctl/ctl_scsi_all.c +++ b/sys/cam/ctl/ctl_scsi_all.c @@ -109,12 +109,12 @@ ctl_scsi_command_string(struct ctl_scsiio *ctsio, } void -ctl_scsi_path_string(union ctl_io *io, char *path_str, int len) +ctl_scsi_path_string(struct ctl_io_hdr *hdr, char *path_str, int len) { snprintf(path_str, len, "(%u:%u:%u/%u): ", - io->io_hdr.nexus.initid, io->io_hdr.nexus.targ_port, - io->io_hdr.nexus.targ_lun, io->io_hdr.nexus.targ_mapped_lun); + hdr->nexus.initid, hdr->nexus.targ_port, + hdr->nexus.targ_lun, hdr->nexus.targ_mapped_lun); } /* @@ -130,7 +130,7 @@ ctl_scsi_sense_sbuf(struct ctl_scsiio *ctsio, if ((ctsio == NULL) || (sb == NULL)) return(-1); - ctl_scsi_path_string((union ctl_io *)ctsio, path_str, sizeof(path_str)); + ctl_scsi_path_string(&ctsio->io_hdr, path_str, sizeof(path_str)); if (flags & SSS_FLAG_PRINT_COMMAND) { sbuf_cat(sb, path_str); diff --git a/sys/cam/ctl/ctl_scsi_all.h b/sys/cam/ctl/ctl_scsi_all.h index 5e99acddf01c..ebf69c967978 100644 --- a/sys/cam/ctl/ctl_scsi_all.h +++ b/sys/cam/ctl/ctl_scsi_all.h @@ -43,7 +43,7 @@ int ctl_scsi_command_string(struct ctl_scsiio *ctsio, int ctl_scsi_sense_sbuf(struct ctl_scsiio *ctsio, struct scsi_inquiry_data *inq_data, struct sbuf *sb, scsi_sense_string_flags flags); -void ctl_scsi_path_string(union ctl_io *io, char *path_str, int strlen); +void ctl_scsi_path_string(struct ctl_io_hdr *hdr, char *path_str, int strlen); char *ctl_scsi_sense_string(struct ctl_scsiio *ctsio, struct scsi_inquiry_data *inq_data, char *str, int str_len); diff --git a/sys/cam/ctl/ctl_util.c b/sys/cam/ctl/ctl_util.c index dc7a9177deeb..3ab37aa4ab14 100644 --- a/sys/cam/ctl/ctl_util.c +++ b/sys/cam/ctl/ctl_util.c @@ -732,7 +732,7 @@ ctl_io_sbuf(union ctl_io *io, struct sbuf *sb) const char *task_desc; char path_str[64]; - ctl_scsi_path_string(io, path_str, sizeof(path_str)); + ctl_scsi_path_string(&io->io_hdr, path_str, sizeof(path_str)); switch (io->io_hdr.io_type) { case CTL_IO_SCSI: @@ -785,7 +785,7 @@ ctl_io_error_sbuf(union ctl_io *io, struct scsi_inquiry_data *inq_data, } } - ctl_scsi_path_string(io, path_str, sizeof(path_str)); + ctl_scsi_path_string(&io->io_hdr, path_str, sizeof(path_str)); sbuf_cat(sb, path_str); if (status_desc == NULL) @@ -862,7 +862,7 @@ ctl_data_print(union ctl_io *io) return; if (io->scsiio.kern_sg_entries > 0) /* XXX: Implement */ return; - ctl_scsi_path_string(io, path_str, sizeof(path_str)); + ctl_scsi_path_string(&io->io_hdr, path_str, sizeof(path_str)); len = min(io->scsiio.kern_data_len, 4096); for (i = 0; i < len; ) { sbuf_new(&sb, str, sizeof(str), SBUF_FIXEDLEN); diff --git a/usr.sbin/ctladm/ctladm.c b/usr.sbin/ctladm/ctladm.c index 67beef1e041e..5b73e22d6c0d 100644 --- a/usr.sbin/ctladm/ctladm.c +++ b/usr.sbin/ctladm/ctladm.c @@ -1272,7 +1272,7 @@ cctl_start_stop(int fd, int lun, int iid, int retries, int start, goto bailout; } - ctl_scsi_path_string(io, scsi_path, sizeof(scsi_path)); + ctl_scsi_path_string(&io->io_hdr, scsi_path, sizeof(scsi_path)); if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS) { fprintf(stdout, "%s LUN %s successfully\n", scsi_path, (start) ? "started" : "stopped"); @@ -1993,7 +1993,7 @@ cctl_get_inquiry(int fd, int lun, int iid, int retries, retval = 1; ctl_io_error_print(io, NULL, stderr); } else if (path_str != NULL) - ctl_scsi_path_string(io, path_str, path_len); + ctl_scsi_path_string(&io->io_hdr, path_str, path_len); bailout: ctl_scsi_free_io(io); @@ -2391,7 +2391,7 @@ cctl_persistent_reserve_out(int fd, int lun, int iid, } if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS) { char scsi_path[40]; - ctl_scsi_path_string(io, scsi_path, sizeof(scsi_path)); + ctl_scsi_path_string(&io->io_hdr, scsi_path, sizeof(scsi_path)); fprintf( stdout, "%sPERSISTENT RESERVE OUT executed " "successfully\n", scsi_path); } else