From owner-svn-src-all@FreeBSD.ORG Sat Aug 2 19:59:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E279176C; Sat, 2 Aug 2014 19:59:19 +0000 (UTC) Received: from svn.freebsd.org (svn.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 B6AE72721; Sat, 2 Aug 2014 19:59:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s72JxJlp047352; Sat, 2 Aug 2014 19:59:19 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s72JxJjn047351; Sat, 2 Aug 2014 19:59:19 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201408021959.s72JxJjn047351@svn.freebsd.org> From: Alexander Motin Date: Sat, 2 Aug 2014 19:59:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269442 - head/sys/cam/ctl X-SVN-Group: head 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.18 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: Sat, 02 Aug 2014 19:59:20 -0000 Author: mav Date: Sat Aug 2 19:59:19 2014 New Revision: 269442 URL: http://svnweb.freebsd.org/changeset/base/269442 Log: Fix some bugs in RECEIVE COPY STATUS data. MFC after: 3 days Modified: head/sys/cam/ctl/ctl_tpc.c Modified: head/sys/cam/ctl/ctl_tpc.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc.c Sat Aug 2 19:51:10 2014 (r269441) +++ head/sys/cam/ctl/ctl_tpc.c Sat Aug 2 19:59:19 2014 (r269442) @@ -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);