diff options
author | Alasdair G Kergon <agk@redhat.com> | 2011-10-23 15:55:17 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2011-10-23 15:55:17 -0400 |
commit | d136f2efdf3a4faba47f58603f8ace2207234d75 (patch) | |
tree | 0b2e94980503cdae7f326219d792d98b10e54a0f /drivers | |
parent | 899e3ee404961a90b828ad527573aaaac39f0ab1 (diff) |
dm kcopyd: fix job_pool leak
Fix memory leak introduced by commit a6e50b409d3f9e0833e69c3c9cca822e8fa4adbb
(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 c6ea41fbbe08f270a8edef99dc369faf809d1bd6
(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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/dm-kcopyd.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/dm-kcopyd.c b/drivers/md/dm-kcopyd.c index f82147029636..32ac70861d66 100644 --- a/drivers/md/dm-kcopyd.c +++ b/drivers/md/dm-kcopyd.c | |||
@@ -628,6 +628,7 @@ void *dm_kcopyd_prepare_callback(struct dm_kcopyd_client *kc, | |||
628 | job->kc = kc; | 628 | job->kc = kc; |
629 | job->fn = fn; | 629 | job->fn = fn; |
630 | job->context = context; | 630 | job->context = context; |
631 | job->master_job = job; | ||
631 | 632 | ||
632 | atomic_inc(&kc->nr_jobs); | 633 | atomic_inc(&kc->nr_jobs); |
633 | 634 | ||