Skip to content

Commit

Permalink
[S390] tape block: complete request with correct locking
Browse files Browse the repository at this point in the history
__blk_end_request must be called with request queue lock held. We need to use
blk_end_request rather than  __blk_end_request.

Signed-off-by: Frank Munzert <munzert@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Frank Munzert authored and Martin Schwidefsky committed Oct 28, 2008
1 parent da5aae7 commit 7a4a1cc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/s390/char/tape_block.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ tapeblock_trigger_requeue(struct tape_device *device)
static void
tapeblock_end_request(struct request *req, int error)
{
if (__blk_end_request(req, error, blk_rq_bytes(req)))
if (blk_end_request(req, error, blk_rq_bytes(req)))
BUG();
}

Expand Down Expand Up @@ -166,7 +166,7 @@ tapeblock_requeue(struct work_struct *work) {
nr_queued++;
spin_unlock(get_ccwdev_lock(device->cdev));

spin_lock(&device->blk_data.request_queue_lock);
spin_lock_irq(&device->blk_data.request_queue_lock);
while (
!blk_queue_plugged(queue) &&
elv_next_request(queue) &&
Expand All @@ -176,7 +176,9 @@ tapeblock_requeue(struct work_struct *work) {
if (rq_data_dir(req) == WRITE) {
DBF_EVENT(1, "TBLOCK: Rejecting write request\n");
blkdev_dequeue_request(req);
spin_unlock_irq(&device->blk_data.request_queue_lock);
tapeblock_end_request(req, -EIO);
spin_lock_irq(&device->blk_data.request_queue_lock);
continue;
}
blkdev_dequeue_request(req);
Expand Down

0 comments on commit 7a4a1cc

Please sign in to comment.