diff options
| author | Jens Axboe <axboe@suse.de> | 2002-10-27 17:39:19 -0800 |
|---|---|---|
| committer | Jens Axboe <axboe@suse.de> | 2002-10-27 17:39:19 -0800 |
| commit | 6f04a530fa6fbcc8ad1329ce2c6b135a7b7742b6 (patch) | |
| tree | 301dfb58f95a142b8910b9385d7c7de7f485ef2d /include/linux | |
| parent | c5868eb784c333e89aa404ac4936a3e29f224303 (diff) | |
[PATCH] request references and list deletion/insertion checking
o Always use list_del_init() on request queuelist, this allows us to
sanity check the integrity of the request on insertion and removal.
So we can complain loudly instead of silently corrupting memory.
o Add references to requests. This is cheap, since we dont have to use
an atomic variable for it (all puts are inside queue lock). We've had
a bug in IDE for years where we want to inspect request state after
io completion, but this is not possible to do race free right now.
REQ_BLOCK_PC and sgio will need this too, for checking io residual
etc. This is not just a theoretical race, I've seen it happen.
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/blk.h | 4 | ||||
| -rw-r--r-- | include/linux/blkdev.h | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/blk.h b/include/linux/blk.h index 775d021167c1..b225609f2ee7 100644 --- a/include/linux/blk.h +++ b/include/linux/blk.h @@ -44,7 +44,9 @@ struct request *elv_next_request(request_queue_t *q); static inline void blkdev_dequeue_request(struct request *req) { - list_del(&req->queuelist); + BUG_ON(list_empty(&req->queuelist)); + + list_del_init(&req->queuelist); if (req->q) elv_remove_request(req->q, req); diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index cd9b016a8993..de87dee16f83 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -26,6 +26,8 @@ struct request { struct list_head queuelist; /* looking for ->queue? you must _not_ * access it directly, use * blkdev_dequeue_request! */ + int ref_count; + void *elevator_private; unsigned char cmd[16]; |
