From 6f04a530fa6fbcc8ad1329ce2c6b135a7b7742b6 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Sun, 27 Oct 2002 17:39:19 -0800 Subject: [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. --- include/linux/blkdev.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/linux/blkdev.h') 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]; -- cgit v1.2.3