Weirdness in error handling in SCSI and block layers.
Hi list.
I recently noticed something wrong in error handling in between SCSI and block device driver layers.
The problem is that SCSI errors are not actually passed to block device layer. When scsi_end_request() calls end_that_request_chunk() it passes only the uptodate value which set earlier, at the end of scsi_io_completion(), and only indicate whether request succeeded or failed. Eventually __end_that_request_first() calls bio_endio() with either -EIO or uptodate value (that in case of success will be 0). As a result, instead of getting error code that more or less indicates what kind of error took place, block device layer always gets -EIO.
Any comments/ideas?
Alexander Sandler.
PS: Please CC to me.