Re: [dm-devel] [PATCH] dm-region-hash: fix strange usage of mempool_alloc.

2017-05-03 Thread NeilBrown
On Wed, May 03 2017, Mikulas Patocka wrote: > On Mon, 24 Apr 2017, NeilBrown wrote: >> >> I had a look at how the allocation 'dm_region' objects are used, >> and it would take a bit of work to make it really safe. >> My guess is __rh_find() should be allowed to fail, and the various >> callers

Re: [dm-devel] [PATCH] dm-region-hash: fix strange usage of mempool_alloc.

2017-05-03 Thread Mikulas Patocka
On Mon, 24 Apr 2017, NeilBrown wrote: > On Fri, Apr 21 2017, Mikulas Patocka wrote: > > > On Mon, 10 Apr 2017, NeilBrown wrote: > > > >> mempool_alloc() should only be called with GFP_ATOMIC when > >> it is not safe to wait. Passing __GFP_NOFAIL to kmalloc() > >> says that it is safe to wait

Re: [dm-devel] [PATCH] dm-region-hash: fix strange usage of mempool_alloc.

2017-04-23 Thread NeilBrown
On Fri, Apr 21 2017, Mikulas Patocka wrote: > On Mon, 10 Apr 2017, NeilBrown wrote: > >> mempool_alloc() should only be called with GFP_ATOMIC when >> it is not safe to wait. Passing __GFP_NOFAIL to kmalloc() >> says that it is safe to wait indefinitely. So this code is >> inconsistent. >> >>

Re: [dm-devel] [PATCH] dm-region-hash: fix strange usage of mempool_alloc.

2017-04-21 Thread Mikulas Patocka
On Mon, 10 Apr 2017, NeilBrown wrote: > mempool_alloc() should only be called with GFP_ATOMIC when > it is not safe to wait. Passing __GFP_NOFAIL to kmalloc() > says that it is safe to wait indefinitely. So this code is > inconsistent. > > Clearly it is OK to wait indefinitely in this code,

[dm-devel] [PATCH] dm-region-hash: fix strange usage of mempool_alloc.

2017-04-09 Thread NeilBrown
mempool_alloc() should only be called with GFP_ATOMIC when it is not safe to wait. Passing __GFP_NOFAIL to kmalloc() says that it is safe to wait indefinitely. So this code is inconsistent. Clearly it is OK to wait indefinitely in this code, and mempool_alloc() is able to do that. So just use