Date: Wed, 15 Feb 1995 08:44:38 +0200 (SAT) From: John Hay <jhay@mikom.csir.co.za> To: bugs@FreeBSD.org, hackers@FreeBSD.org Subject: BUG + fix in scsi_base.c Message-ID: <199502150644.IAA08039@zibbi.mikom.csir.co.za>
next in thread | raw e-mail | index | archive | help
>From a week or two ago I got kernel panics as soon as I tried to access my tape drive. I traced it to sys/scsi/scsi_base.c where some code were added to print the return values of the sense command. My tape drive returned a extended flags value of 0x20, so the key that is the lower 4 bits, is 0. The code uses "key-1" to index into a table and then the kernel go to never- never land. Here is a fix for this. Will somebody please apply it? -- John Hay -- jhay@mikom.csir.co.za *** sys/scsi/scsi_base.c.org Wed Feb 1 08:17:29 1995 --- sys/scsi/scsi_base.c Wed Feb 15 08:29:19 1995 *************** *** 661,667 **** */ static char *sense_key_text[] = { ! "RECOVERED ERROR", "NOT READY", "MEDIUM ERROR", "HARDWARE FAILURE", "ILLEGAL REQUEST", "UNIT ATTENTION", "DATA PROTECT", --- 661,667 ---- */ static char *sense_key_text[] = { ! "NO SENSE", "RECOVERED ERROR", "NOT READY", "MEDIUM ERROR", "HARDWARE FAILURE", "ILLEGAL REQUEST", "UNIT ATTENTION", "DATA PROTECT", *************** *** 686,692 **** case 0x70: ! printf("%s", sense_key_text[key - 1]); info = ntohl(*((long *) ext->info)); if (sense->error_code & SSD_ERRCODE_VALID) { --- 686,692 ---- case 0x70: ! printf("%s", sense_key_text[key]); info = ntohl(*((long *) ext->info)); if (sense->error_code & SSD_ERRCODE_VALID) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199502150644.IAA08039>