Borislav Petkov 2c8fc86760 ide-disk: Fix request requeuing
Simon Kirby reported that on his RAID setup with idedisk underneath
the box OOMs after a couple of days of runtime. Running with
CONFIG_DEBUG_KMEMLEAK pointed to idedisk_prep_fn() which unconditionally
allocates an ide_cmd struct. However, ide_requeue_and_plug() can be
called more than once per request, either from the request issue or the
IRQ handler path and do blk_peek_request() ends up in idedisk_prep_fn()
repeatedly, allocating a struct ide_cmd everytime and "forgetting" the
previous pointer.

Make sure the code reuses the old allocated chunk.

Reported-and-tested-by: Simon Kirby <sim@hostway.ca>
Cc: <stable@kernel.org> [ 39.x, 3.0.x ]
Link: http://marc.info/?l=linux-kernel&m=131667641517919
Link: http://lkml.kernel.org/r/20110922072643.GA27232@hostway.ca
Signed-off-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-10-03 14:28:18 -04:00
..
2009-05-17 19:12:25 +02:00
2010-10-26 10:17:29 -07:00
2011-08-04 01:29:51 -07:00
2009-05-17 19:12:25 +02:00
2010-11-22 11:37:21 -08:00
2011-03-10 08:52:07 +01:00
2011-06-11 15:06:48 -07:00
2011-03-09 19:54:27 +01:00
2011-10-03 14:28:18 -04:00
2009-09-01 17:52:57 -07:00
2009-03-27 12:46:34 +01:00
2009-05-17 19:12:25 +02:00
2009-05-17 19:12:25 +02:00
2009-04-08 14:13:03 +02:00
2009-05-17 19:12:25 +02:00
2011-03-10 08:52:07 +01:00
2009-05-17 19:12:25 +02:00
2011-03-31 11:26:23 -03:00
2010-01-19 11:30:09 -08:00
2011-03-17 14:05:34 +01:00
2009-04-08 14:13:03 +02:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00