aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2007-11-09 06:52:45 -0500
committerJens Axboe <jens.axboe@oracle.com>2007-11-09 06:52:45 -0500
commitd85532ed284e63b5c56eaf2418f262822af60be4 (patch)
tree2c938f0ebe419ccc18632367c5c9d3f301fc9c36
parent8578007065bd27ec077a74b5814f0fe4df040180 (diff)
block: fix requeue handling in blk_queue_invalidate_tags()
Credit goes to juergen.kadidlo@exasol.com for diagnosing this issue and supplying the initial patch. blk_queue_invalidate_tags() must use the proper requeueing paths instead of open coding the re-add of the request, otherwise we bug out in rq accounting. Just switch to using blk_requeue_request(), that takes care of end-tag handling as well and also adds the blktrace REQUEUE notify event that is also appropriate here. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r--block/ll_rw_blk.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index 75c98d58f4dd..3d489915fd22 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -1143,22 +1143,9 @@ EXPORT_SYMBOL(blk_queue_start_tag);
1143void blk_queue_invalidate_tags(struct request_queue *q) 1143void blk_queue_invalidate_tags(struct request_queue *q)
1144{ 1144{
1145 struct list_head *tmp, *n; 1145 struct list_head *tmp, *n;
1146 struct request *rq;
1147
1148 list_for_each_safe(tmp, n, &q->tag_busy_list) {
1149 rq = list_entry_rq(tmp);
1150 1146
1151 if (rq->tag == -1) { 1147 list_for_each_safe(tmp, n, &q->tag_busy_list)
1152 printk(KERN_ERR 1148 blk_requeue_request(q, list_entry_rq(tmp));
1153 "%s: bad tag found on list\n", __FUNCTION__);
1154 list_del_init(&rq->queuelist);
1155 rq->cmd_flags &= ~REQ_QUEUED;
1156 } else
1157 blk_queue_end_tag(q, rq);
1158
1159 rq->cmd_flags &= ~REQ_STARTED;
1160 __elv_add_request(q, rq, ELEVATOR_INSERT_BACK, 0);
1161 }
1162} 1149}
1163 1150
1164EXPORT_SYMBOL(blk_queue_invalidate_tags); 1151EXPORT_SYMBOL(blk_queue_invalidate_tags);