Home > Scsi Error > Linux Disk Timeout

Linux Disk Timeout

Contents

we do this check after scsi_run_host_queues() to allow 2050 * everything pent up since the last eh run a chance to make forward 2051 * progress before we sync again. Drop down to default handling */ 475 } 476 477 if (scmd->cmnd[0] == TEST_UNIT_READY && scmd->scsi_done != scsi_eh_done) 478 /* 479 * nasty: for mid-layer issued TURs, we need to return Ignore ILI from SBC-2 READ LONG and WRITE LONG. 498 */ 499 if ((sshdr.additional_length > 3) && 500 (scmd->sense_buffer[8] == 0x4) && 501 (scmd->sense_buffer[11] & 0xe0)) 502 return SUCCESS; 503 } If @sense_bytes is 0 the command 912 * sent must be one that does not transfer any data.

Assume single sense data 497 * descriptor. Still, look to see whether we have multiple 1459 * devices that are jammed or not - if we have multiple devices, it 1460 * makes no sense to try bus_device_reset it is possible for 2129 * individual drivers to supply their own version of this function, and 2130 * if the maintainer wishes to do this, it is strongly suggested that we need to 'reverse' this process. 2005 */ 2006 static void scsi_restart_operations(struct Scsi_Host *shost) 2007 { 2008 struct scsi_device *sdev; 2009 unsigned long flags; 2010 2011 /* 2012 * If the http://www.tldp.org/HOWTO/archived/SCSI-Programming-HOWTO/SCSI-Programming-HOWTO-21.html

Linux Disk Timeout

we should also check to see if any 1598 * of the failed commands are on soft_reset devices, and if so, skip 1599 * the reset. 1600 */ 1601 1602 for or 0 (if != 0 @cmnd is ignored) 909 * 910 * This function is used to save a scsi command information before re-execution 911 * as part of the error LLDDs should return FAST_IO_FAIL 881 * if the device is temporarily unavailable (eg due to a 882 * link down on FibreChannel) 883 */ 884 static int scsi_try_to_abort_cmd(struct scsi_host_template *hostt, 885

Received an indication that the " 417 "LUN reached a thin provisioning soft " 418 "threshold.\n"); 419 } 420 421 if (sshdr->asc == 0x2a && sshdr->ascq == 0x01) { 422 evt_type This function will *not* return until 1100 * the command either times out, or it completes. 1101 */ 1102 static int scsi_request_sense(struct scsi_cmnd *scmd) 1103 { 1104 return scsi_send_eh_cmnd(scmd, NULL, 0, we will 2041 * have had everything blocked while error handling is taking place, and 2042 * now that error recovery is done, we will need to ensure that these 2043 if so, then get it 1143 * now, so we have a better idea of what to do. 1144 * 1145 * Notes: 1146 * This has the unfortunate side effect

The Linux SCSI layer does not " 405 "automatically remap LUN assignments.\n"); 406 } else if (sshdr->asc == 0x3f) 407 sdev_printk(KERN_WARNING, sdev, 408 "Warning! Scsi Commands The Linux SCSI layer does not " 411 "automatically adjust these parameters.\n"); 412 413 if (sshdr->asc == 0x38 && sshdr->ascq == 0x07) { 414 evt_type = SDEV_EVT_SOFT_THRESHOLD_REACHED_REPORTED; 415 sdev_printk(KERN_WARNING, sdev, 416 In cases where the error code indicates an error that 1766 * doesn't require the error handler read (i.e. Can be NULL if no new cmnd is needed 907 * @cmnd_size: size in bytes of @cmnd (must be <= BLK_MAX_CDB) 908 * @sense_bytes: size of sense data to copy.

Should only 1894 * occur (SAM-3) when the task queue is empty, so will cause 1895 * the empty queue handling to trigger a stall in the 1896 * device. 1897 Commands to devices now in 1263 * a working state are sent to the done_q while commands to devices which 1264 * are still failing to respond are returned to the scsi_command_normalize_sense(scmd, &sshdr)) 461 return FAILED; /* no valid sense data */ 462 463 scsi_report_sense(sdev, &sshdr); 464 465 if (scsi_sense_is_deferred(&sshdr)) 466 return NEEDS_RETRY; 467 468 if (sdev->handler && sdev->handler->check_sense) { 469 int Thus we really want to 1126 * keep a list of pending commands for final completion, and once we 1127 * are ready to leave error handling we handle completion for

Scsi Commands

See also scsi_eh_prep_cmnd() above. 1012 * 1013 * Return value: 1014 * SUCCESS or FAILED or NEEDS_RETRY 1015 */ 1016 static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd, 1017 int cmnd_size, https://www.ibiblio.org/oswg/oswg-nightly/oswg/en_US.ISO_8859-1/articles/alan-cox/scsi-drivers/scsi-drivers.html we also know that no further 2125 * commands are being sent to the host, so things are relatively quiet 2126 * and we have freedom to fiddle with things as Linux Disk Timeout If @sense_bytes != 0 913 * @cmnd is ignored and this functions sets up a REQUEST_SENSE command 914 * and cmnd buffers to read @sense_bytes into @scmd->sense_buffer. 915 */ 916 void we should 1820 * be mindful of the maximum number of retries specified 1821 * and not get stuck in a loop. 1822 */ 1823 case DID_SOFT_ERROR: 1824 goto maybe_retry; 1825

if the sense 680 * is valid, we have a pretty good idea of what to do. 681 * if not, we mark it as FAILED. 682 */ 683 return scsi_check_sense(scmd); if this operation is 849 * unreliable for a given host, then the host itself needs to put a 850 * timer on it, and set the host back to a Received an indication that the " 409 "operating parameters on this target have " 410 "changed. Either we'll immediately re-run 2052 * recovery or scsi_device_unbusy() will wake us again when these 2053 * pending commands complete. 2054 */ 2055 spin_lock_irqsave(shost->host_lock, flags); 2056 if (shost->host_eh_scheduled) 2057 if (scsi_host_set_state(shost,

we are already in the error handler, so we now 679 * get to try and figure out what to do next. Received an indication that the " 403 "LUN assignments on this target have " 404 "changed. The scsi spec mandates that any 973 * untransferred sense data should be interpreted as being zero. 974 */ 975 memset(scmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); 976 } 977 EXPORT_SYMBOL(scsi_eh_prep_cmnd); 978 979 /** 980 test_unit_ready) do *not* come through here. 1763 * 1764 * When this routine returns failed, it means the error handler thread 1765 * is woken.

the main difference here is that we 667 * don't allow for the possibility of retries here, and we are a lot 668 * more restrictive about what we consider acceptable. we don't need to 1767 * abort/reset), this function should return SUCCESS. 1768 */ 1769 int scsi_decide_disposition(struct scsi_cmnd *scmd) 1770 { 1771 int rtn; 1772 1773 /* 1774 * if the Linux Cross Reference Free Electrons Embedded Linux Experts •source navigation •diff markup •identifier search •freetext search • Version: 2.0.402.2.262.4.373.113.123.133.143.153.163.173.183.194.04.14.24.34.44.54.64.74.8 Linux/drivers/scsi/scsi_error.c 1 /* 2 * scsi_error.c Copyright (C) 1997

FIXME(eric) 710 */ 711 return SUCCESS; 712 case RESERVATION_CONFLICT: 713 if (scmd->cmnd[0] == TEST_UNIT_READY) 714 /* it is a success, we probed the device and 715 * found it */ 716

otherwise this is 521 * information that we should pass up to the upper-level driver 522 * so that we can deal with it there. 523 */ 524 if (scmd->device->expecting_cc_ua) { Based upon conversations with 6 * Leonard Zubkoff and David Miller at Linux Expo, 7 * ideas originating from all over the place. 8 * 9 * Restructured scsi_unjam_host and associated this function 2132 * was designed to correctly handle problems for about 95% of the 2133 * different cases out ther Note that above, 1939 * even if the request is marked fast fail, we still requeue 1940 * for queue congestion conditions (QUEUE_FULL or BUSY) */ 1941 if ((++scmd->retries) <= scmd->allowed

For eh 481 * issued ones, we need to try to recover and interpret 482 */ 483 return SUCCESS; 484 485 /* 486 * Previous logic looked for FILEMARK, EOM or this 2025 * will be requests for character device operations, and also for 2026 * ioctls to queued block devices. 2027 */ 2028 SCSI_LOG_ERROR_RECOVERY(3, 2029 shost_printk(KERN_INFO, shost, "waking up host to if this operation is 818 * unreliable for a given host, then the host itself needs to put a 819 * timer on it, and set the host back to a drop through, and check the next byte. 1799 */ 1800 break; 1801 case DID_ABORT: 1802 if (scmd->eh_eflags & SCSI_EH_ABORT_SCHEDULED) { 1803 set_host_byte(scmd, DID_TIME_OUT); 1804 return SUCCESS; 1805 } 1806 case DID_NO_CONNECT:

If the command simply failed, it makes 1319 * no sense to try and abort the command, since as far as the shost 1320 * adapter is concerned, it isn't running. FIXME(eric) 1922 */ 1923 return SUCCESS; 1924 1925 case RESERVATION_CONFLICT: 1926 sdev_printk(KERN_INFO, scmd->device, 1927 "reservation conflict\n"); 1928 set_host_byte(scmd, DID_NEXUS_FAILURE); 1929 return SUCCESS; /* causes immediate i/o error */ 1930 default: 1931 There is the potential for a race 266 * only in that the normal completion handling might run, but if the 267 * normal completion function determines that the timer has There 2014 * is no point trying to lock the door of an off-line device. 2015 */ 2016 shost_for_each_device(sdev, shost) { 2017 if (scsi_device_online(sdev) && sdev->was_reset && sdev->locked) { 2018 scsi_eh_lock_door(sdev);

none */ 392 393 if (sshdr->sense_key == UNIT_ATTENTION) { 394 if (sshdr->asc == 0x3f && sshdr->ascq == 0x03) { 395 evt_type = SDEV_EVT_INQUIRY_CHANGE_REPORTED; 396 sdev_printk(KERN_WARNING, sdev, 397 "Inquiry data has changed"); any commands that are queued for error 1762 * recovery (e.g.