Skip to contentSkip to conversation

non-zero result with NO_SENSE

DISCUSSION Laurie Costello 2 participants 2 messages Nov 2, 2006 SCSI

lore
Share & tools
lore
#0 lore raw

I'm researching a problem with data corruption on linux 2.6.9.

I'm seeing results of scsi_print_sense() in the system log, which brought me

to this chunk of code. Is it correct to process a non-zero result with

NO_SENSE as if an error didn't occur or was recovered?

Laurie Costello

Oct  9 08:16:03 localhost kernel: Info fld=0x0, Current sdv: sense key No Sense
        /* An error occurred */

        if (driver_byte(result) != 0 &&         /* An error occurred */

            (SCpnt->sense_buffer[0] & 0x7f) == 0x70) { /* Sense current */

                switch (SCpnt->sense_buffer[2]) {

......deleted some case statement code

                case RECOVERED_ERROR: /* an error occurred, but it recovered */

                case NO_SENSE: /* LLDD got sense data */

                        /*

                         * Inform the user, but make sure that it's not treated

                         * as a hard error.

                         */

                        scsi_print_sense("sd", SCpnt);

                        SCpnt->result = 0;

                        SCpnt->sense_buffer[0] = 0x0;
                       good_bytes = this_count;

                        break;
#1 lore raw
Quoted 7 lines · Laurie Costello

I'm researching a problem with data corruption on linux 2.6.9.

I'm seeing results of scsi_print_sense() in the system log, which brought me

to this chunk of code. Is it correct to process a non-zero result with

NO_SENSE as if an error didn't occur or was recovered?

Laurie,
Well it isn't ideal obviously. The problem is that sd sits between a SCSI direct access device and the SCSI block subsystem. SCSI devices try and be helpful and tell the application client things like: the data was read but required 3 retries and ECC. The block layer is only interested in errors that impact the current IO, so sd has no slot to file these warnings in, apart from the system log. There was some proposal about logging such errors and warning (but where to store the log :-) ) and disks already do a fair amount of logging themselves.

Even more worrying are deferred errors. Something like a cached write that at some later time gets an IO error when the disk tries to write its cache to the media. This should become a more interesting area as disks get larger non-volatile caches.

There are tools such as smartmontools that can monitor the health of disks.

Doug Gilbert