From: Alasdair G Kergon Fix a memory leak inadvertently introduced during simplification of cell_release_singleton() in commit 6f94a4c45a6f744383f9f695dde019998db3df55 ("dm thin: fix stacked bi_next usage"). A cell's hlist_del() must be accompanied by a mempool_free(). Signed-off-by: Alasdair G Kergon --- drivers/md/dm-thin.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) Index: linux-3.4-rc5/drivers/md/dm-thin.c =================================================================== --- linux-3.4-rc5.orig/drivers/md/dm-thin.c +++ linux-3.4-rc5/drivers/md/dm-thin.c @@ -303,9 +303,13 @@ static void cell_release(struct cell *ce */ static void __cell_release_singleton(struct cell *cell, struct bio *bio) { - hlist_del(&cell->list); + struct bio_prison *prison = cell->prison; + BUG_ON(cell->holder != bio); BUG_ON(!bio_list_empty(&cell->bios)); + + hlist_del(&cell->list); + mempool_free(cell, prison->cell_pool); } static void cell_release_singleton(struct cell *cell, struct bio *bio)