scsi_target crashed when initiator is using LSI PCI-X Ultra320SC SI card

jerry_ch_lee at wistron.com.tw jerry_ch_lee at wistron.com.tw
Thu Feb 19 22:41:26 PST 2004




Hi Chuck:

It works! Great job! Thanks!

Best regards,

Jerry Lee
Senior Engineer
Broadband & Storage
Wistron Corp.
(TEL)     886-2-86911521
(CELL)   886-920894353
(EMAIL) jerry_ch_lee at wistron.com.tw
(MSN)    i_am_jhlee at hotmail.com





Chuck Tuffli <chuck_tuffli at agilent.com> on 2004/02/19 10:52:02 PM
                                                              
                                                              
                                                              
 To:      Jerry CH Lee/WHQ/Wistron at Wistron                    
                                                              
                                                              
 cc:      freebsd-scsi at freebsd.org                            
                                                              
                                                              
                                                              
                                                              
 Subject: Re: scsi_target crashed when initiator is using LSI 
          PCI-X Ultra320 SC    SI card                        
                                                              


This document is classified as     Normal



I've been meaning to post a patch, but haven't gotten to it yet. The
setup I tested with was similar (WinXP initiator and targ(4)). It
appears that Windows sends a REPORT LUNS command which scsi_target
doesn't support. In turn, the unsupported command causes scsi_target
to abort. Here is a partial patch of the changes I made (this is
against 4.9). Note that the CVS logs for scsi_target make some
reference to a fix for REPORT LUNS, but I haven't looked into it at
all.

---chuck

--- ../st_49/scsi_cmds.c        Tue Feb 18 14:07:10 2003
+++ scsi_cmds.c Tue Jan 20 12:40:31 2004
@@ -143,11 +143,14 @@
        }
        if (last_cmd->cmd == ILLEGAL_CDB) {
                if (event != ATIO_WORK) {
-                       warnx("no done func for %#x???",
                        a_descr->cdb[0]);
-                       abort();
+                       warnx("cdb %#x not handled (evt=%d)", a_descr->cdb[0],
+                                       event);
+                       free_ccb((union ccb *)ctio);
+                       return (1);
                }
                /* Not found, return illegal request */
-               warnx("cdb %#x not handled", a_descr->cdb[0]);
+               if (debug)
+                       warnx("cdb %#x not handled (evt=%d)", a_descr->cdb[0],
event);
                tcmd_illegal_req(atio, ctio);
                send_ccb((union ccb *)ctio, /*priority*/1);
                return (0);
@@ -245,12 +248,11 @@

        /* Fill out the supplied CTIO */
        if (ctio != NULL) {
-               /* No autosense yet
                bcopy(sense, &ctio->sense_data, sizeof(*sense));
-               ctio->sense_len = sizeof(*sense);  XXX
-               */
+               ctio->sense_len = sizeof(*sense);
+
                ctio->ccb_h.flags &= ~CAM_DIR_MASK;
-               ctio->ccb_h.flags |= CAM_DIR_NONE | /* CAM_SEND_SENSE | */
+               ctio->ccb_h.flags |= CAM_DIR_NONE | CAM_SEND_SENSE |
                                     CAM_SEND_STATUS;
                ctio->dxfer_len = 0;
                ctio->scsi_status = SCSI_STATUS_CHECK_COND;
@@ -313,6 +315,10 @@
        } else {
                bcopy(&inq_data, ctio->data_ptr, sizeof(inq_data));
                ctio->dxfer_len = inq_data.additional_length + 4;
+
+               /* calculate the residual */
+               ctio->resid = ctio->dxfer_len - SCSI_CDB6_LEN(inq->length);
+
                ctio->dxfer_len = min(ctio->dxfer_len,


On Wed, Feb 18, 2004 at 08:17:43PM -0500, jerry_ch_lee at wistron.com.tw wrote:
>
>
>
> Hi:
>
> Did anyone have such experience?
> My setup is:
>
> Initiator: PC with Windows 2000, LSI Ultra320 SCSI card
> Target: PC with FreeBSD 5.2, on-board Adaptec 7899W chip
> command on target:
> ./scsi_target 0:1:0 file
>
> When I rescan hardware on initiator, the Target's scsi_target program
> exit
> itself.
> Then I re-run scsi_target program again, and rescan hardware on
> initiator,
> then...
>
> Target crashed! ( I can't grab the log because it's not logged in
> messages)
>
> Any idea?
>
> Best regards,
>
> Jerry Lee
> Senior Engineer
> Broadband & Storage
> Wistron Corp.
> (TEL)     886-2-86911521
> (CELL)   886-920894353
> (EMAIL) jerry_ch_lee at wistron.com.tw
> (MSN)    i_am_jhlee at hotmail.com
>
>
> _______________________________________________
> freebsd-scsi at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-scsi
> To unsubscribe, send any mail to "freebsd-scsi-unsubscribe at freebsd.org"

--
Chuck Tuffli    <chuck_tuffli AT NO_SPAM agilent DOT com>
Agilent Technologies, Storage Area Networking





More information about the freebsd-scsi mailing list