forked from Minki/linux
dm kcopyd: fix job_pool leak
Fix memory leak introduced by commita6e50b409d
(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 commitc6ea41fbbe
(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>
This commit is contained in:
parent
899e3ee404
commit
d136f2efdf
@ -628,6 +628,7 @@ void *dm_kcopyd_prepare_callback(struct dm_kcopyd_client *kc,
|
||||
job->kc = kc;
|
||||
job->fn = fn;
|
||||
job->context = context;
|
||||
job->master_job = job;
|
||||
|
||||
atomic_inc(&kc->nr_jobs);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user