Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757378AbbGGPL6 (ORCPT ); Tue, 7 Jul 2015 11:11:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53787 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757274AbbGGPLn (ORCPT ); Tue, 7 Jul 2015 11:11:43 -0400 Date: Tue, 7 Jul 2015 11:11:42 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Mike Snitzer cc: "Alasdair G. Kergon" , Edward Thornber , Andrew Morton , David Rientjes , Vivek Goyal , linux-kernel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com Subject: [PATCH 5/7] dm-thin: use kvmalloc In-Reply-To: Message-ID: References: User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1607 Lines: 47 Make dm-thin use kvmalloc instead of kmalloc because there was a reported allocation failure - see https://bugzilla.redhat.com/show_bug.cgi?id=1225370 Signed-off-by: Mikulas Patocka --- drivers/md/dm-thin.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Index: linux-4.2-rc1/drivers/md/dm-thin.c =================================================================== --- linux-4.2-rc1.orig/drivers/md/dm-thin.c 2015-07-06 17:32:35.000000000 +0200 +++ linux-4.2-rc1/drivers/md/dm-thin.c 2015-07-06 17:36:28.000000000 +0200 @@ -2791,7 +2791,7 @@ static void __pool_destroy(struct pool * mempool_destroy(pool->mapping_pool); dm_deferred_set_destroy(pool->shared_read_ds); dm_deferred_set_destroy(pool->all_io_ds); - kfree(pool); + kvfree(pool); } static struct kmem_cache *_new_mapping_cache; @@ -2813,7 +2813,7 @@ static struct pool *pool_create(struct m return (struct pool *)pmd; } - pool = kmalloc(sizeof(*pool), GFP_KERNEL); + pool = kvmalloc(sizeof(*pool), GFP_KERNEL); if (!pool) { *error = "Error allocating memory for pool"; err_p = ERR_PTR(-ENOMEM); @@ -2908,7 +2908,7 @@ bad_wq: bad_kcopyd_client: dm_bio_prison_destroy(pool->prison); bad_prison: - kfree(pool); + kvfree(pool); bad_pool: if (dm_pool_metadata_close(pmd)) DMWARN("%s: dm_pool_metadata_close() failed.", __func__); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/