Commit 4303cc87 authored by Jens Axboe's avatar Jens Axboe

[PATCH] ide-cd buglets

Assorted small ide-cd fixes, found and fixed by Andy Polyakov
<appro@fy.chalmers.se>.

- CHECK_CONDITION really wants to be SAM_STAT_CHECK_CONDITION, the damn
  bit shift by one bit again

- Set sense_len correctly

- Do post_transform() on the right buffer.
parent ba094e84
...@@ -666,8 +666,10 @@ static void cdrom_end_request (ide_drive_t *drive, int uptodate) ...@@ -666,8 +666,10 @@ static void cdrom_end_request (ide_drive_t *drive, int uptodate)
struct cdrom_info *info = drive->driver_data; struct cdrom_info *info = drive->driver_data;
void *sense = &info->sense_data; void *sense = &info->sense_data;
if (failed && failed->sense) if (failed && failed->sense) {
sense = failed->sense; sense = failed->sense;
failed->sense_len = rq->sense_len;
}
cdrom_analyze_sense_data(drive, failed, sense); cdrom_analyze_sense_data(drive, failed, sense);
} }
...@@ -723,7 +725,7 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret) ...@@ -723,7 +725,7 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret)
* scsi status byte * scsi status byte
*/ */
if ((rq->flags & REQ_BLOCK_PC) && !rq->errors) if ((rq->flags & REQ_BLOCK_PC) && !rq->errors)
rq->errors = CHECK_CONDITION; rq->errors = SAM_STAT_CHECK_CONDITION;
/* Check for tray open. */ /* Check for tray open. */
if (sense_key == NOT_READY) { if (sense_key == NOT_READY) {
...@@ -1609,11 +1611,13 @@ static inline int cdrom_write_check_ireason(ide_drive_t *drive, int len, int ire ...@@ -1609,11 +1611,13 @@ static inline int cdrom_write_check_ireason(ide_drive_t *drive, int len, int ire
static void post_transform_command(struct request *req) static void post_transform_command(struct request *req)
{ {
char *ibuf = req->buffer; char *ibuf = req->data;
u8 *c = req->cmd; u8 *c = req->cmd;
if (!blk_pc_request(req)) if (!blk_pc_request(req))
return; return;
if (!ibuf)
return;
/* /*
* set ansi-revision and response data as atapi * set ansi-revision and response data as atapi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment