diff options
-rw-r--r-- | drivers/ide/ide-cd.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 64207df8da82..2de76cc08f61 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -506,15 +506,22 @@ int ide_cd_queue_pc(ide_drive_t *drive, const unsigned char *cmd, | |||
506 | return (flags & REQ_FAILED) ? -EIO : 0; | 506 | return (flags & REQ_FAILED) ? -EIO : 0; |
507 | } | 507 | } |
508 | 508 | ||
509 | static void ide_cd_error_cmd(ide_drive_t *drive, struct ide_cmd *cmd) | 509 | /* |
510 | * returns true if rq has been completed | ||
511 | */ | ||
512 | static bool ide_cd_error_cmd(ide_drive_t *drive, struct ide_cmd *cmd) | ||
510 | { | 513 | { |
511 | unsigned int nr_bytes = cmd->nbytes - cmd->nleft; | 514 | unsigned int nr_bytes = cmd->nbytes - cmd->nleft; |
512 | 515 | ||
513 | if (cmd->tf_flags & IDE_TFLAG_WRITE) | 516 | if (cmd->tf_flags & IDE_TFLAG_WRITE) |
514 | nr_bytes -= cmd->last_xfer_len; | 517 | nr_bytes -= cmd->last_xfer_len; |
515 | 518 | ||
516 | if (nr_bytes > 0) | 519 | if (nr_bytes > 0) { |
517 | ide_complete_rq(drive, 0, nr_bytes); | 520 | ide_complete_rq(drive, 0, nr_bytes); |
521 | return true; | ||
522 | } | ||
523 | |||
524 | return false; | ||
518 | } | 525 | } |
519 | 526 | ||
520 | static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) | 527 | static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) |
@@ -679,7 +686,8 @@ out_end: | |||
679 | } | 686 | } |
680 | 687 | ||
681 | if (uptodate == 0 && rq->bio) | 688 | if (uptodate == 0 && rq->bio) |
682 | ide_cd_error_cmd(drive, cmd); | 689 | if (ide_cd_error_cmd(drive, cmd)) |
690 | return ide_stopped; | ||
683 | 691 | ||
684 | /* make sure it's fully ended */ | 692 | /* make sure it's fully ended */ |
685 | if (blk_fs_request(rq) == 0) { | 693 | if (blk_fs_request(rq) == 0) { |