diff options
Diffstat (limited to 'drivers/block/paride/pcd.c')
-rw-r--r-- | drivers/block/paride/pcd.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/block/paride/pcd.c b/drivers/block/paride/pcd.c index 2d5dc0af55e4..425f81586a31 100644 --- a/drivers/block/paride/pcd.c +++ b/drivers/block/paride/pcd.c | |||
@@ -719,9 +719,12 @@ static void do_pcd_request(struct request_queue * q) | |||
719 | if (pcd_busy) | 719 | if (pcd_busy) |
720 | return; | 720 | return; |
721 | while (1) { | 721 | while (1) { |
722 | pcd_req = elv_next_request(q); | 722 | if (!pcd_req) { |
723 | if (!pcd_req) | 723 | pcd_req = elv_next_request(q); |
724 | return; | 724 | if (!pcd_req) |
725 | return; | ||
726 | blkdev_dequeue_request(pcd_req); | ||
727 | } | ||
725 | 728 | ||
726 | if (rq_data_dir(pcd_req) == READ) { | 729 | if (rq_data_dir(pcd_req) == READ) { |
727 | struct pcd_unit *cd = pcd_req->rq_disk->private_data; | 730 | struct pcd_unit *cd = pcd_req->rq_disk->private_data; |
@@ -734,8 +737,10 @@ static void do_pcd_request(struct request_queue * q) | |||
734 | pcd_busy = 1; | 737 | pcd_busy = 1; |
735 | ps_set_intr(do_pcd_read, NULL, 0, nice); | 738 | ps_set_intr(do_pcd_read, NULL, 0, nice); |
736 | return; | 739 | return; |
737 | } else | 740 | } else { |
738 | __blk_end_request_cur(pcd_req, -EIO); | 741 | __blk_end_request_all(pcd_req, -EIO); |
742 | pcd_req = NULL; | ||
743 | } | ||
739 | } | 744 | } |
740 | } | 745 | } |
741 | 746 | ||
@@ -744,7 +749,8 @@ static inline void next_request(int err) | |||
744 | unsigned long saved_flags; | 749 | unsigned long saved_flags; |
745 | 750 | ||
746 | spin_lock_irqsave(&pcd_lock, saved_flags); | 751 | spin_lock_irqsave(&pcd_lock, saved_flags); |
747 | __blk_end_request_cur(pcd_req, err); | 752 | if (!__blk_end_request_cur(pcd_req, err)) |
753 | pcd_req = NULL; | ||
748 | pcd_busy = 0; | 754 | pcd_busy = 0; |
749 | do_pcd_request(pcd_queue); | 755 | do_pcd_request(pcd_queue); |
750 | spin_unlock_irqrestore(&pcd_lock, saved_flags); | 756 | spin_unlock_irqrestore(&pcd_lock, saved_flags); |