From owner-svn-src-head@freebsd.org Wed Feb 21 14:05:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0C09F045BB; Wed, 21 Feb 2018 14:05:13 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2FDF7C2B3; Wed, 21 Feb 2018 14:05:13 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DBFD197BA; Wed, 21 Feb 2018 14:05:13 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1LE5D4r087427; Wed, 21 Feb 2018 14:05:13 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1LE5DkB087426; Wed, 21 Feb 2018 14:05:13 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201802211405.w1LE5DkB087426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 21 Feb 2018 14:05:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329708 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 329708 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Feb 2018 14:05:14 -0000 Author: trasz Date: Wed Feb 21 14:05:13 2018 New Revision: 329708 URL: https://svnweb.freebsd.org/changeset/base/329708 Log: Use proper buffer length (the announce_buf char pointer used to be anarray), broken in r317143. This fixes those weird "cd0: Attempt" messages at boot. PR: 222103 Reviewed by: scottl@ MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14369 Modified: head/sys/cam/scsi/scsi_cd.c Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Wed Feb 21 11:31:29 2018 (r329707) +++ head/sys/cam/scsi/scsi_cd.c Wed Feb 21 14:05:13 2018 (r329708) @@ -1057,6 +1057,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) cdp = &softc->params; announce_buf = softc->announce_temp; + bzero(announce_buf, CD_ANNOUNCETMP_SZ); rdcap = (struct scsi_read_capacity_data *)csio->data_ptr; @@ -1127,7 +1128,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) &sense_key_desc, &asc_desc); snprintf(announce_buf, - sizeof(announce_buf), + CD_ANNOUNCETMP_SZ, "Attempt to query device " "size failed: %s, %s", sense_key_desc, @@ -1138,7 +1139,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) && (csio->scsi_status == SCSI_STATUS_BUSY)) { snprintf(announce_buf, - sizeof(announce_buf), + CD_ANNOUNCETMP_SZ, "Attempt to query device " "size failed: SCSI Status: %s", scsi_status_string(csio));