diff options
Diffstat (limited to 'drivers/s390/char/tape_block.c')
-rw-r--r-- | drivers/s390/char/tape_block.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/s390/char/tape_block.c b/drivers/s390/char/tape_block.c index 5d035e4939dc..1e7967675980 100644 --- a/drivers/s390/char/tape_block.c +++ b/drivers/s390/char/tape_block.c | |||
@@ -93,7 +93,7 @@ __tapeblock_end_request(struct tape_request *ccw_req, void *data) | |||
93 | device->blk_data.block_position = -1; | 93 | device->blk_data.block_position = -1; |
94 | device->discipline->free_bread(ccw_req); | 94 | device->discipline->free_bread(ccw_req); |
95 | if (!list_empty(&device->req_queue) || | 95 | if (!list_empty(&device->req_queue) || |
96 | elv_next_request(device->blk_data.request_queue)) | 96 | blk_peek_request(device->blk_data.request_queue)) |
97 | tapeblock_trigger_requeue(device); | 97 | tapeblock_trigger_requeue(device); |
98 | } | 98 | } |
99 | 99 | ||
@@ -162,19 +162,16 @@ tapeblock_requeue(struct work_struct *work) { | |||
162 | spin_lock_irq(&device->blk_data.request_queue_lock); | 162 | spin_lock_irq(&device->blk_data.request_queue_lock); |
163 | while ( | 163 | while ( |
164 | !blk_queue_plugged(queue) && | 164 | !blk_queue_plugged(queue) && |
165 | elv_next_request(queue) && | 165 | (req = blk_fetch_request(queue)) && |
166 | nr_queued < TAPEBLOCK_MIN_REQUEUE | 166 | nr_queued < TAPEBLOCK_MIN_REQUEUE |
167 | ) { | 167 | ) { |
168 | req = elv_next_request(queue); | ||
169 | if (rq_data_dir(req) == WRITE) { | 168 | if (rq_data_dir(req) == WRITE) { |
170 | DBF_EVENT(1, "TBLOCK: Rejecting write request\n"); | 169 | DBF_EVENT(1, "TBLOCK: Rejecting write request\n"); |
171 | blkdev_dequeue_request(req); | ||
172 | spin_unlock_irq(&device->blk_data.request_queue_lock); | 170 | spin_unlock_irq(&device->blk_data.request_queue_lock); |
173 | blk_end_request_all(req, -EIO); | 171 | blk_end_request_all(req, -EIO); |
174 | spin_lock_irq(&device->blk_data.request_queue_lock); | 172 | spin_lock_irq(&device->blk_data.request_queue_lock); |
175 | continue; | 173 | continue; |
176 | } | 174 | } |
177 | blkdev_dequeue_request(req); | ||
178 | nr_queued++; | 175 | nr_queued++; |
179 | spin_unlock_irq(&device->blk_data.request_queue_lock); | 176 | spin_unlock_irq(&device->blk_data.request_queue_lock); |
180 | rc = tapeblock_start_request(device, req); | 177 | rc = tapeblock_start_request(device, req); |