From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vivek Goyal Subject: Re: [PATCH 4/7] dm: introduce dm_kvmalloc Date: Mon, 6 Jul 2015 08:42:12 -0400 Message-ID: <20150706124212.GA4515@redhat.com> References: Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: Mikulas Patocka Cc: Mike Snitzer , Edward Thornber , dm-devel@redhat.com, "Alasdair G. Kergon" List-Id: dm-devel.ids On Fri, Jul 03, 2015 at 04:59:54PM -0400, Mikulas Patocka wrote: [..] > Index: linux-4.1/drivers/md/dm-table.c > =================================================================== > --- linux-4.1.orig/drivers/md/dm-table.c 2015-07-02 19:21:16.000000000 +0200 > +++ linux-4.1/drivers/md/dm-table.c 2015-07-02 19:28:18.000000000 +0200 > @@ -131,6 +131,43 @@ static int setup_btree_index(unsigned in > return 0; > } > > +void *dm_kvmalloc_node(size_t size, gfp_t gfp, int node) > +{ > + void *p; > + unsigned uninitialized_var(noio_flag); > + > + /* vmalloc doesn't support no-wait allocations */ > + WARN_ON(!(gfp & __GFP_WAIT)); > + Should this WARN_ON() be moved after kmalloc(). This should be triggered only if we use vmalloc(). Thanks Vivek