4.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Joe Thornber <[email protected]>

commit 9153df7405ae04c1b0466de720e0a685cfea1a3a upstream.

There were two cases where dm_cell_visit_release() was being called,
which removes the cell from the prison's rbtree, but the callers didn't
also return the cell to the mempool.  Fix this by having them call
free_prison_cell().

This leak manifested as the 'kmalloc-96' slab growing until OOM.

Fixes: 651f5fa2a3 ("dm cache: defer whole cells")
Signed-off-by: Joe Thornber <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/md/dm-cache-target.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/drivers/md/dm-cache-target.c
+++ b/drivers/md/dm-cache-target.c
@@ -1729,6 +1729,8 @@ static void remap_cell_to_origin_clear_d
                remap_to_origin(cache, bio);
                issue(cache, bio);
        }
+
+       free_prison_cell(cache, cell);
 }
 
 static void remap_cell_to_cache_dirty(struct cache *cache, struct 
dm_bio_prison_cell *cell,
@@ -1763,6 +1765,8 @@ static void remap_cell_to_cache_dirty(st
                remap_to_cache(cache, bio, cblock);
                issue(cache, bio);
        }
+
+       free_prison_cell(cache, cell);
 }
 
 /*----------------------------------------------------------------*/


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to