diff options
-rw-r--r-- | drivers/ide/ide-cd.c | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 11d8d5b870b7..0201201c6e48 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * Copyright (C) 1994-1996 Scott Snyder <snyder@fnald0.fnal.gov> | 4 | * Copyright (C) 1994-1996 Scott Snyder <snyder@fnald0.fnal.gov> |
5 | * Copyright (C) 1996-1998 Erik Andersen <andersee@debian.org> | 5 | * Copyright (C) 1996-1998 Erik Andersen <andersee@debian.org> |
6 | * Copyright (C) 1998-2000 Jens Axboe <axboe@suse.de> | 6 | * Copyright (C) 1998-2000 Jens Axboe <axboe@suse.de> |
7 | * Copyright (C) 2005, 2007 Bartlomiej Zolnierkiewicz | 7 | * Copyright (C) 2005, 2007-2009 Bartlomiej Zolnierkiewicz |
8 | * | 8 | * |
9 | * May be copied or modified under the terms of the GNU General Public | 9 | * May be copied or modified under the terms of the GNU General Public |
10 | * License. See linux/COPYING for more information. | 10 | * License. See linux/COPYING for more information. |
@@ -711,22 +711,8 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) | |||
711 | while (thislen > 0) { | 711 | while (thislen > 0) { |
712 | int blen = min_t(int, thislen, cmd->nleft); | 712 | int blen = min_t(int, thislen, cmd->nleft); |
713 | 713 | ||
714 | if (cmd->nleft == 0) { | 714 | if (cmd->nleft == 0) |
715 | if (blk_fs_request(rq) && !write) | ||
716 | /* | ||
717 | * If the buffers are full, pipe the rest into | ||
718 | * oblivion. | ||
719 | */ | ||
720 | ide_pad_transfer(drive, 0, thislen); | ||
721 | else { | ||
722 | printk(KERN_ERR PFX "%s: confused, missing data\n", | ||
723 | drive->name); | ||
724 | blk_dump_rq_flags(rq, rq_data_dir(rq) | ||
725 | ? "cdrom_newpc_intr, write" | ||
726 | : "cdrom_newpc_intr, read"); | ||
727 | } | ||
728 | break; | 715 | break; |
729 | } | ||
730 | 716 | ||
731 | ide_pio_bytes(drive, cmd, write, blen); | 717 | ide_pio_bytes(drive, cmd, write, blen); |
732 | cmd->last_xfer_len += blen; | 718 | cmd->last_xfer_len += blen; |
@@ -739,8 +725,15 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) | |||
739 | } | 725 | } |
740 | 726 | ||
741 | /* pad, if necessary */ | 727 | /* pad, if necessary */ |
742 | if (!blk_fs_request(rq) && len > 0) | 728 | if (len > 0) { |
743 | ide_pad_transfer(drive, write, len); | 729 | if (blk_fs_request(rq) == 0 || write == 0) |
730 | ide_pad_transfer(drive, write, len); | ||
731 | else { | ||
732 | printk(KERN_ERR PFX "%s: confused, missing data\n", | ||
733 | drive->name); | ||
734 | blk_dump_rq_flags(rq, "cdrom_newpc_intr"); | ||
735 | } | ||
736 | } | ||
744 | 737 | ||
745 | if (blk_pc_request(rq)) { | 738 | if (blk_pc_request(rq)) { |
746 | timeout = rq->timeout; | 739 | timeout = rq->timeout; |