Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Aug 2014 08:29:25 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r269572 - stable/10/sys/cam/ctl
Message-ID:  <53e095e5.5b4d.4e7bec02@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Tue Aug  5 08:29:24 2014
New Revision: 269572
URL: http://svnweb.freebsd.org/changeset/base/269572

Log:
  MFC r269442:
  Fix some bugs in RECEIVE COPY STATUS data.

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	Tue Aug  5 08:29:16 2014	(r269571)
+++ stable/10/sys/cam/ctl/ctl_tpc.c	Tue Aug  5 08:29:24 2014	(r269572)
@@ -481,7 +481,8 @@ ctl_receive_copy_failure_details(struct 
 
 	data = (struct scsi_receive_copy_failure_details_data *)ctsio->kern_data_ptr;
 	if (list_copy.completed && (list_copy.error || list_copy.abort)) {
-		scsi_ulto4b(sizeof(*data) - 4, data->available_data);
+		scsi_ulto4b(sizeof(*data) - 4 + list_copy.sense_len,
+		    data->available_data);
 		data->copy_command_status = RCS_CCS_ERROR;
 	} else
 		scsi_ulto4b(0, data->available_data);
@@ -553,7 +554,8 @@ ctl_receive_copy_status_lid4(struct ctl_
 	ctsio->kern_rel_offset = 0;
 
 	data = (struct scsi_receive_copy_status_lid4_data *)ctsio->kern_data_ptr;
-	scsi_ulto4b(sizeof(*data) - 4, data->available_data);
+	scsi_ulto4b(sizeof(*data) - 4 + list_copy.sense_len,
+	    data->available_data);
 	data->response_to_service_action = list_copy.service_action;
 	if (list_copy.completed) {
 		if (list_copy.error)
@@ -566,14 +568,10 @@ ctl_receive_copy_status_lid4(struct ctl_
 		data->copy_command_status = RCS_CCS_INPROG_FG;
 	scsi_ulto2b(list_copy.curops, data->operation_counter);
 	scsi_ulto4b(UINT32_MAX, data->estimated_status_update_delay);
-	if (list_copy.curbytes <= UINT32_MAX) {
-		data->transfer_count_units = RCS_TC_BYTES;
-		scsi_ulto4b(list_copy.curbytes, data->transfer_count);
-	} else {
-		data->transfer_count_units = RCS_TC_MBYTES;
-		scsi_ulto4b(list_copy.curbytes >> 20, data->transfer_count);
-	}
+	data->transfer_count_units = RCS_TC_BYTES;
+	scsi_u64to8b(list_copy.curbytes, data->transfer_count);
 	scsi_ulto2b(list_copy.curseg, data->segments_processed);
+	data->length_of_the_sense_data_field = list_copy.sense_len;
 	data->sense_data_length = list_copy.sense_len;
 	memcpy(data->sense_data, &list_copy.sense_data, list_copy.sense_len);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53e095e5.5b4d.4e7bec02>