ide-cd: fix "missing data" handling in cdrom_pc_intr()

If drive still wants to transfer the data we need to pad the transfer
instead of just finishing the request.
Acked-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 5a5222d9
...@@ -1500,9 +1500,11 @@ static ide_startstop_t cdrom_pc_intr (ide_drive_t *drive) ...@@ -1500,9 +1500,11 @@ static ide_startstop_t cdrom_pc_intr (ide_drive_t *drive)
if (xferfunc) { if (xferfunc) {
if (!rq->data) { if (!rq->data) {
printk(KERN_ERR "%s: confused, missing data\n",
drive->name);
blk_dump_rq_flags(rq, write ? "cdrom_pc_intr, write" blk_dump_rq_flags(rq, write ? "cdrom_pc_intr, write"
: "cdrom_pc_intr, read"); : "cdrom_pc_intr, read");
goto confused; goto pad;
} }
/* Transfer the data. */ /* Transfer the data. */
xferfunc(drive, rq->data, thislen); xferfunc(drive, rq->data, thislen);
...@@ -1515,7 +1517,6 @@ static ide_startstop_t cdrom_pc_intr (ide_drive_t *drive) ...@@ -1515,7 +1517,6 @@ static ide_startstop_t cdrom_pc_intr (ide_drive_t *drive)
if (write && blk_sense_request(rq)) if (write && blk_sense_request(rq))
rq->sense_len += thislen; rq->sense_len += thislen;
} else { } else {
confused:
printk (KERN_ERR "%s: cdrom_pc_intr: The drive " printk (KERN_ERR "%s: cdrom_pc_intr: The drive "
"appears confused (ireason = 0x%02x). " "appears confused (ireason = 0x%02x). "
"Trying to recover by ending request.\n", "Trying to recover by ending request.\n",
...@@ -1524,7 +1525,7 @@ static ide_startstop_t cdrom_pc_intr (ide_drive_t *drive) ...@@ -1524,7 +1525,7 @@ static ide_startstop_t cdrom_pc_intr (ide_drive_t *drive)
cdrom_end_request(drive, 0); cdrom_end_request(drive, 0);
return ide_stopped; return ide_stopped;
} }
pad:
/* /*
* If we haven't moved enough data to satisfy the drive, * If we haven't moved enough data to satisfy the drive,
* add some padding. * add some padding.
......
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