From owner-svn-src-all@freebsd.org Mon Oct 5 10:34:42 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 027F099AEAB; Mon, 5 Oct 2015 10:34:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD0ECAAF; Mon, 5 Oct 2015 10:34:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t95AYfML068735; Mon, 5 Oct 2015 10:34:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t95AYfma068734; Mon, 5 Oct 2015 10:34:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201510051034.t95AYfma068734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 5 Oct 2015 10:34:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r288767 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Oct 2015 10:34:42 -0000 Author: mav Date: Mon Oct 5 10:34:40 2015 New Revision: 288767 URL: https://svnweb.freebsd.org/changeset/base/288767 Log: MFC r287913: Report number of failed XCOPY segment. Modified: stable/10/sys/cam/ctl/ctl_tpc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_tpc.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_tpc.c Mon Oct 5 09:46:23 2015 (r288766) +++ stable/10/sys/cam/ctl/ctl_tpc.c Mon Oct 5 10:34:40 2015 (r288767) @@ -820,7 +820,9 @@ tpc_process_b2b(struct tpc_list *list) off_t srclba, dstlba, numbytes, donebytes, roundbytes; int numlba; uint32_t srcblock, dstblock, pb, pbo, adj; + uint8_t csi[4]; + scsi_ulto4b(list->curseg, csi); if (list->stage == 1) { while ((tior = TAILQ_FIRST(&list->allio)) != NULL) { TAILQ_REMOVE(&list->allio, tior, links); @@ -834,7 +836,9 @@ tpc_process_b2b(struct tpc_list *list) } else if (list->error) { ctl_set_sense(list->ctsio, /*current_error*/ 1, /*sense_key*/ SSD_KEY_COPY_ABORTED, - /*asc*/ 0x0d, /*ascq*/ 0x01, SSD_ELEM_NONE); + /*asc*/ 0x0d, /*ascq*/ 0x01, + SSD_ELEM_COMMAND, csi, sizeof(csi), + SSD_ELEM_NONE); return (CTL_RETVAL_ERROR); } list->cursectors += list->segsectors; @@ -849,7 +853,9 @@ tpc_process_b2b(struct tpc_list *list) if (sl >= CTL_MAX_LUNS || dl >= CTL_MAX_LUNS) { ctl_set_sense(list->ctsio, /*current_error*/ 1, /*sense_key*/ SSD_KEY_COPY_ABORTED, - /*asc*/ 0x08, /*ascq*/ 0x04, SSD_ELEM_NONE); + /*asc*/ 0x08, /*ascq*/ 0x04, + SSD_ELEM_COMMAND, csi, sizeof(csi), + SSD_ELEM_NONE); return (CTL_RETVAL_ERROR); } if (pbo > 0) @@ -878,7 +884,9 @@ tpc_process_b2b(struct tpc_list *list) if (numbytes % srcblock != 0 || numbytes % dstblock != 0) { ctl_set_sense(list->ctsio, /*current_error*/ 1, /*sense_key*/ SSD_KEY_COPY_ABORTED, - /*asc*/ 0x26, /*ascq*/ 0x0A, SSD_ELEM_NONE); + /*asc*/ 0x26, /*ascq*/ 0x0A, + SSD_ELEM_COMMAND, csi, sizeof(csi), + SSD_ELEM_NONE); return (CTL_RETVAL_ERROR); } @@ -962,7 +970,9 @@ tpc_process_verify(struct tpc_list *list struct scsi_ec_segment_verify *seg; struct tpc_io *tio; uint64_t sl; + uint8_t csi[4]; + scsi_ulto4b(list->curseg, csi); if (list->stage == 1) { while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { TAILQ_REMOVE(&list->allio, tio, links); @@ -975,7 +985,9 @@ tpc_process_verify(struct tpc_list *list } else if (list->error) { ctl_set_sense(list->ctsio, /*current_error*/ 1, /*sense_key*/ SSD_KEY_COPY_ABORTED, - /*asc*/ 0x0d, /*ascq*/ 0x01, SSD_ELEM_NONE); + /*asc*/ 0x0d, /*ascq*/ 0x01, + SSD_ELEM_COMMAND, csi, sizeof(csi), + SSD_ELEM_NONE); return (CTL_RETVAL_ERROR); } else return (CTL_RETVAL_COMPLETE); @@ -987,7 +999,9 @@ tpc_process_verify(struct tpc_list *list if (sl >= CTL_MAX_LUNS) { ctl_set_sense(list->ctsio, /*current_error*/ 1, /*sense_key*/ SSD_KEY_COPY_ABORTED, - /*asc*/ 0x08, /*ascq*/ 0x04, SSD_ELEM_NONE); + /*asc*/ 0x08, /*ascq*/ 0x04, + SSD_ELEM_COMMAND, csi, sizeof(csi), + SSD_ELEM_NONE); return (CTL_RETVAL_ERROR); } @@ -1019,7 +1033,9 @@ tpc_process_register_key(struct tpc_list struct tpc_io *tio; uint64_t dl; int datalen; + uint8_t csi[4]; + scsi_ulto4b(list->curseg, csi); if (list->stage == 1) { while ((tio = TAILQ_FIRST(&list->allio)) != NULL) { TAILQ_REMOVE(&list->allio, tio, links); @@ -1033,7 +1049,9 @@ tpc_process_register_key(struct tpc_list } else if (list->error) { ctl_set_sense(list->ctsio, /*current_error*/ 1, /*sense_key*/ SSD_KEY_COPY_ABORTED, - /*asc*/ 0x0d, /*ascq*/ 0x01, SSD_ELEM_NONE); + /*asc*/ 0x0d, /*ascq*/ 0x01, + SSD_ELEM_COMMAND, csi, sizeof(csi), + SSD_ELEM_NONE); return (CTL_RETVAL_ERROR); } else return (CTL_RETVAL_COMPLETE); @@ -1045,7 +1063,9 @@ tpc_process_register_key(struct tpc_list if (dl >= CTL_MAX_LUNS) { ctl_set_sense(list->ctsio, /*current_error*/ 1, /*sense_key*/ SSD_KEY_COPY_ABORTED, - /*asc*/ 0x08, /*ascq*/ 0x04, SSD_ELEM_NONE); + /*asc*/ 0x08, /*ascq*/ 0x04, + SSD_ELEM_COMMAND, csi, sizeof(csi), + SSD_ELEM_NONE); return (CTL_RETVAL_ERROR); } @@ -1346,6 +1366,7 @@ tpc_process(struct tpc_list *list) struct scsi_ec_segment *seg; struct ctl_scsiio *ctsio = list->ctsio; int retval = CTL_RETVAL_COMPLETE; + uint8_t csi[4]; if (list->service_action == EC_WUT) { if (list->token != NULL) @@ -1373,9 +1394,12 @@ tpc_process(struct tpc_list *list) retval = tpc_process_register_key(list); break; default: + scsi_ulto4b(list->curseg, csi); ctl_set_sense(ctsio, /*current_error*/ 1, /*sense_key*/ SSD_KEY_COPY_ABORTED, - /*asc*/ 0x26, /*ascq*/ 0x09, SSD_ELEM_NONE); + /*asc*/ 0x26, /*ascq*/ 0x09, + SSD_ELEM_COMMAND, csi, sizeof(csi), + SSD_ELEM_NONE); goto done; } if (retval == CTL_RETVAL_QUEUED)