]> git.baikalelectronics.ru Git - kernel.git/commit
ide-disk: Fix request requeuing
authorBorislav Petkov <bp@alien8.de>
Mon, 3 Oct 2011 18:28:18 +0000 (14:28 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Oct 2011 18:28:18 +0000 (14:28 -0400)
commit6dcc64d4a770cbe3b041dc64cf9929dbf9a753bf
tree21507c7b823953e8632ae4a1853d1196b6ff02a3
parent22902c43b57099f32999e33f24c8d7f9f51b24df
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>
drivers/ide/ide-disk.c