From nobody Sun Dec 28 17:33:27 2025 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 4dfRK31Xmhz6M5k2 for ; Sun, 28 Dec 2025 17:33: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 4dfRK30pdcz3YG8 for ; Sun, 28 Dec 2025 17:33:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766943207; 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=NXngkROQoW4MS+izx/iBgD4clkmluBJ80rE+2102V3s=; b=yA8gNNJ3WObRQSL+fCwqP6+pE/R6ROEIM8Z0+0HWH+Mo7YSe81rifwW/+E+cFZJoIagIgT PcocJEJWOHaHbW/PBuEq7pZrYQ0xrnc6JOM+M7acmu/NV98Ce/04i2i3cy4SpaKoEQa9G3 uLLb90Qh/UG3WMyfXAa5NzD86W68dK28ZGWMQ5b/Nufl1fi7+zOx+EUplD0+UAUOKbVQHM zoCy10lk51ajBswl11C6q3wrmUpWnDRboCkaggXRV4j/v4tKPbh4+ZmAU31R+iX7yLx/lQ FO+i2ISTTeGLHA9MpsMEBQgH/asF/buvbMB/2CSxcU8i1Q9kJptLFERWRjQ7Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766943207; 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=NXngkROQoW4MS+izx/iBgD4clkmluBJ80rE+2102V3s=; b=GCe/ea3K8RwMF7tD4dUcLW688LjdnuaHCInkz5OxusHIoLR1d7zQFQIqLq6ZkCrysrqT6+ S4qgjnctp3nX9dwHpg3nz/ByWFmk+A6yVdUMzfHwpaEnHvEYjl0iXKlQjeSkiFzdNzuIpF CMkr4CTysYdjsK7XscNKUT44AsVK2Ld+cmg3IoRfgOUqhYUUeqsP/slGd1Fx8SLbrCzKfc i+Z1BDNlVOuAe9up3JiMco3yjoiJOwpFoYmZ7QbrSBx3vwgfndQqdSSId57kLyZIHnqv3U 9snR9mebnNKTaPD/KCeGjY/u7o4sBW9gGaSxT9ZcxajO0MGd48OWNBMCPSmetg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766943207; a=rsa-sha256; cv=none; b=DRcoSDoSg+gGlyvGN3/28mhiUeSVBAwa5g/9dM5oD6p1ySZT2iQ4D5PNWg5CSMKDFzjVBy OnB4glIUQeHxpMklMVDdwuFFPtzjnMA9FtwIe3yw+ey+yUa14MiLImuTeZWDI2Qt30tooO ppKfc9KmupkG2XaMH2634s8bM6ayzhebEfhqpXl65iuBRE/fTuv+gfcP08Atv6fC9LCNcN TDhQLsPVQ5S3cywbhAyOfm7q1nkxwlZaiHDOJXI/8gU/Px9TdwsqNbdCMuJdKhQfXwlyGx wfX4dTDrYdtSmJTbAH9fqKwp55CcUDpRXK7kWKyWuLk8+wBnXIXK/RxmkqDC4g== 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 4dfRK30Jz1zvFM for ; Sun, 28 Dec 2025 17:33:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24203 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 28 Dec 2025 17:33:27 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: b67a7c062b65 - main - scsi: Make all da error messages greppable 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b67a7c062b65f29448ad5e9e001b03c99869c192 Auto-Submitted: auto-generated Date: Sun, 28 Dec 2025 17:33:27 +0000 Message-Id: <695169e7.24203.22315042@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b67a7c062b65f29448ad5e9e001b03c99869c192 commit b67a7c062b65f29448ad5e9e001b03c99869c192 Author: Warner Losh AuthorDate: 2025-12-28 17:22:15 +0000 Commit: Warner Losh CommitDate: 2025-12-28 17:32:05 +0000 scsi: Make all da error messages greppable Don't split the error messages across lines. We used to do that ages ago, but have relaxed style(9) to encourage the opposite so all error messages can be grepped. This constantly slows me down when I'm helping others find issues, so start here by splitting according to normal style(9) rules with a relaxed line length of 90. Sponsored by: Netflix --- sys/cam/scsi/scsi_da.c | 89 +++++++++++++++++++++++--------------------------- 1 file changed, 40 insertions(+), 49 deletions(-) diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 773a786d08f7..3f18817030c1 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -2059,8 +2059,9 @@ dainit(void) status = xpt_register_async(AC_FOUND_DEVICE, daasync, NULL, NULL); if (status != CAM_REQ_CMP) { - printf("da: Failed to attach master async callback " - "due to status 0x%x!\n", status); + printf( + "da: Failed to attach master async callback due to status 0x%x!\n", + status); } else if (da_send_ordered) { /* Register our shutdown event handler */ if ((EVENTHANDLER_REGISTER(shutdown_post_sync, dashutdown, @@ -2186,10 +2187,10 @@ daasync(void *callback_arg, uint32_t code, path, daasync, AC_FOUND_DEVICE, cgd); - if (status != CAM_REQ_CMP - && status != CAM_REQ_INPROG) - printf("daasync: Unable to attach to new device " - "due to status 0x%x\n", status); + if (status != CAM_REQ_CMP && status != CAM_REQ_INPROG) + printf( + "daasync: Unable to attach to new device due to status 0x%x\n", + status); return; } case AC_ADVINFO_CHANGED: /* Doesn't touch periph */ @@ -2372,8 +2373,7 @@ dasysctlinit(void *context, int pending) SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "optimal_nonseq_zones", CTLFLAG_RD, &softc->optimal_nonseq_zones, - "Optimal Number of Non-Sequentially Written Sequential Write " - "Preferred Zones"); + "Optimal Number of Non-Sequentially Written Sequential Write Preferred Zones"); SYSCTL_ADD_UQUAD(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "max_seq_zones", CTLFLAG_RD, &softc->max_seq_zones, @@ -2859,8 +2859,8 @@ daregister(struct cam_periph *periph, void *arg) M_NOWAIT|M_ZERO); if (softc == NULL) { - printf("daregister: Unable to probe new device. " - "Unable to allocate softc\n"); + printf( + "daregister: Unable to probe new device. Unable to allocate softc\n"); return(CAM_REQ_CMP_ERR); } @@ -3035,8 +3035,8 @@ daregister(struct cam_periph *periph, void *arg) if (cam_iosched_init(&softc->cam_iosched, periph, softc->disk, daschedule) != 0) { - printf("daregister: Unable to probe new device. " - "Unable to allocate iosched memory\n"); + printf( + "daregister: Unable to probe new device. Unable to allocate iosched memory\n"); free(softc, M_DEVBUF); return(CAM_REQ_CMP_ERR); } @@ -3115,8 +3115,9 @@ da_zone_cmd(struct cam_periph *periph, union ccb *ccb, struct bio *bp, zone_sa = da_zone_bio_to_scsi(bp->bio_zone.zone_cmd); if (zone_sa == -1) { - xpt_print(periph->path, "Cannot translate zone " - "cmd %#x to SCSI\n", bp->bio_zone.zone_cmd); + xpt_print(periph->path, + "Cannot translate zone cmd %#x to SCSI\n", + bp->bio_zone.zone_cmd); error = EINVAL; goto bailout; } @@ -3180,8 +3181,7 @@ da_zone_cmd(struct cam_periph *periph, union ccb *ccb, struct bio *bp, if (error != 0) { error = EINVAL; xpt_print(periph->path, - "scsi_ata_zac_mgmt_out() returned an " - "error!"); + "scsi_ata_zac_mgmt_out() returned an error!"); goto bailout; } } @@ -3198,8 +3198,8 @@ da_zone_cmd(struct cam_periph *periph, union ccb *ccb, struct bio *bp, num_entries = rep->entries_allocated; if (num_entries == 0) { - xpt_print(periph->path, "No entries allocated for " - "Report Zones request\n"); + xpt_print(periph->path, + "No entries allocated for Report Zones request\n"); error = EINVAL; goto bailout; } @@ -3208,8 +3208,8 @@ da_zone_cmd(struct cam_periph *periph, union ccb *ccb, struct bio *bp, alloc_size = min(alloc_size, softc->disk->d_maxsize); rz_ptr = malloc(alloc_size, M_SCSIDA, M_NOWAIT | M_ZERO); if (rz_ptr == NULL) { - xpt_print(periph->path, "Unable to allocate memory " - "for Report Zones request\n"); + xpt_print(periph->path, + "Unable to allocate memory for Report Zones request\n"); error = ENOMEM; goto bailout; } @@ -3266,8 +3266,7 @@ da_zone_cmd(struct cam_periph *periph, union ccb *ccb, struct bio *bp, if (error != 0) { error = EINVAL; xpt_print(periph->path, - "scsi_ata_zac_mgmt_in() returned an " - "error!"); + "scsi_ata_zac_mgmt_in() returned an error!"); goto bailout; } } @@ -3599,8 +3598,8 @@ out: mode_buf_len = 192; mode_buf = malloc(mode_buf_len, M_SCSIDA, M_NOWAIT); if (mode_buf == NULL) { - xpt_print(periph->path, "Unable to send mode sense - " - "malloc failure\n"); + xpt_print(periph->path, + "Unable to send mode sense - malloc failure\n"); if ((softc->flags & DA_FLAG_CAN_RC16) != 0) softc->state = DA_STATE_PROBE_RC16; else @@ -3882,8 +3881,7 @@ out: log_dir = malloc(sizeof(*log_dir), M_SCSIDA, M_NOWAIT|M_ZERO); if (log_dir == NULL) { - xpt_print(periph->path, "Couldn't malloc log_dir " - "data\n"); + xpt_print(periph->path, "Couldn't malloc log_dir data\n"); daprobedone(periph, start_ccb); break; } @@ -3932,8 +3930,7 @@ out: id_dir = malloc(sizeof(*id_dir), M_SCSIDA, M_NOWAIT | M_ZERO); if (id_dir == NULL) { - xpt_print(periph->path, "Couldn't malloc id_dir " - "data\n"); + xpt_print(periph->path, "Couldn't malloc id_dir data\n"); daprobedone(periph, start_ccb); break; } @@ -3981,8 +3978,7 @@ out: sup_cap = malloc(sizeof(*sup_cap), M_SCSIDA, M_NOWAIT|M_ZERO); if (sup_cap == NULL) { - xpt_print(periph->path, "Couldn't malloc sup_cap " - "data\n"); + xpt_print(periph->path, "Couldn't malloc sup_cap data\n"); daprobedone(periph, start_ccb); break; } @@ -4032,8 +4028,7 @@ out: ata_zone = malloc(sizeof(*ata_zone), M_SCSIDA, M_NOWAIT|M_ZERO); if (ata_zone == NULL) { - xpt_print(periph->path, "Couldn't malloc ata_zone " - "data\n"); + xpt_print(periph->path, "Couldn't malloc ata_zone data\n"); daprobedone(periph, start_ccb); break; } @@ -4084,8 +4079,7 @@ out: if (bdc == NULL) { xpt_release_ccb(start_ccb); - xpt_print(periph->path, "Couldn't malloc zone VPD " - "data\n"); + xpt_print(periph->path, "Couldn't malloc zone VPD data\n"); break; } scsi_inquiry(&start_ccb->csio, @@ -4201,8 +4195,7 @@ da_delete_unmap(struct cam_periph *periph, union ccb *ccb, struct bio *bp) if (totalcount + c > softc->unmap_max_lba || ranges >= softc->unmap_max_ranges) { xpt_print(periph->path, - "%s issuing short delete %ld > %ld" - "|| %d >= %d", + "%s issuing short delete %ld > %ld || %d >= %d", da_delete_method_desc[softc->delete_method], totalcount + c, softc->unmap_max_lba, ranges, softc->unmap_max_ranges); @@ -4483,8 +4476,8 @@ cmd6workaround(union ccb *ccb) (*cdb != READ_6 && *cdb != WRITE_6)) return 0; - xpt_print(ccb->ccb_h.path, "READ(6)/WRITE(6) not supported, " - "increasing minimum_cmd_size to 10.\n"); + xpt_print(ccb->ccb_h.path, + "READ(6)/WRITE(6) not supported, increasing minimum_cmd_size to 10.\n"); softc->minimum_cmd_size = 10; bcopy(cdb, &cmd6, sizeof(struct scsi_rw_6)); @@ -5124,8 +5117,7 @@ dadone_proberc(struct cam_periph *periph, union ccb *done_ccb) &cgd.inq_data, &sense_key_desc, &asc_desc); snprintf(announce_buf, DA_ANNOUNCETMP_SZ, - "Attempt to query device " - "size failed: %s, %s", + "Attempt to query device size failed: %s, %s", sense_key_desc, asc_desc); } else { if (have_sense) @@ -5135,9 +5127,8 @@ dadone_proberc(struct cam_periph *periph, union ccb *done_ccb) "got CAM status %#x\n", done_ccb->ccb_h.status); } - - xpt_print(periph->path, "fatal error, " - "failed to attach to device\n"); + xpt_print(periph->path, + "fatal error, failed to attach to device\n"); announce_buf = NULL; @@ -5171,8 +5162,8 @@ dadone_proberc(struct cam_periph *periph, union ccb *done_ccb) &softc->sysctl_task); } else { /* XXX This message is useless! */ - xpt_print(periph->path, "fatal error, " - "could not acquire reference count\n"); + xpt_print(periph->path, + "fatal error, could not acquire reference count\n"); } } @@ -5410,8 +5401,7 @@ dadone_probebdc(struct cam_periph *periph, union ccb *done_ccb) DA_ZONE_IF_ATA_SAT : DA_ZONE_IF_SCSI; } else if ((bdc->flags & SVPD_ZBC_MASK) != SVPD_ZBC_NR) { - xpt_print(periph->path, "Unknown zoned " - "type %#x", + xpt_print(periph->path, "Unknown zoned type %#x", bdc->flags & SVPD_ZBC_MASK); } } @@ -6516,8 +6506,9 @@ dasetgeom(struct cam_periph *periph, uint32_t block_len, uint64_t maxsector, if ((cdai.ccb_h.status & CAM_DEV_QFRZN) != 0) cam_release_devq(cdai.ccb_h.path, 0, 0, 0, FALSE); if (cdai.ccb_h.status != CAM_REQ_CMP) { - xpt_print(periph->path, "%s: failed to set read " - "capacity advinfo\n", __func__); + xpt_print(periph->path, + "%s: failed to set read capacity advinfo\n", + __func__); /* Use cam_error_print() to decode the status */ cam_error_print((union ccb *)&cdai, CAM_ESF_CAM_STATUS, CAM_EPF_ALL);