]> git.baikalelectronics.ru Git - kernel.git/commit
dm kcopyd: fix job_pool leak
authorAlasdair G Kergon <agk@redhat.com>
Sun, 23 Oct 2011 19:55:17 +0000 (20:55 +0100)
committerAlasdair G Kergon <agk@redhat.com>
Sun, 23 Oct 2011 19:55:17 +0000 (20:55 +0100)
commit3d5318fb9fed41c96a5e713f16aee88810866326
tree0b2e94980503cdae7f326219d792d98b10e54a0f
parent78426c61c60045fd7113846a0280960338868cb5
dm kcopyd: fix job_pool leak

Fix memory leak introduced by commit eba19b00f8ffee52e74d6008bc02d3166e5b701b
(dm snapshot: skip reading origin when overwriting complete chunk).

When allocating a set of jobs from kc->job_pool, job->master_job must be
set (to point to itself) so that the mempool item gets freed when the
master_job completes.

master_job was introduced by commit 35379879309437eb33665d08962d9b3daa4b0b10
(dm kcopyd: preallocate sub jobs to avoid deadlock)

Reported-by: Michael Leun <ml@newton.leun.net>
Cc: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/dm-kcopyd.c