Re: [PATCH][2.6] WARN_ON_STACK_VAR aka fighting variable lifetimebugs

From: Zwane Mwaikambo
Date: Sat Aug 09 2003 - 14:50:21 EST


This patch adds some elevator checks for stack variables, there are
in fact some in theory in the ide_do_drive_cmd path when the caller passes
args via rq->special as a stack variable and does not call with ide_wait*.

Index: linux-2.6-wli/drivers/block/elevator.c
===================================================================
RCS file: /home/cvs/linux-2.5/drivers/block/elevator.c,v
retrieving revision 1.48
diff -u -p -B -r1.48 elevator.c
--- linux-2.6-wli/drivers/block/elevator.c 27 Jul 2003 01:42:20 -0000 1.48
+++ linux-2.6-wli/drivers/block/elevator.c 9 Aug 2003 18:16:09 -0000
@@ -230,6 +230,11 @@ void __elv_add_request(request_queue_t *
{
struct list_head *insert = &q->queue_head;

+ if (!rq->waiting) {
+ WARN_ON_STACK_VAR(rq);
+ WARN_ON_STACK_VAR(rq->special);
+ }
+
if (at_end)
insert = insert->prev;
if (plug)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/