]> git.baikalelectronics.ru Git - kernel.git/commit
dm verity fec: fix GFP flags used with mempool_alloc()
authorNeilBrown <neilb@suse.com>
Mon, 10 Apr 2017 02:13:00 +0000 (12:13 +1000)
committerMike Snitzer <snitzer@redhat.com>
Wed, 26 Jul 2017 19:55:44 +0000 (15:55 -0400)
commit4e1e918e72c5e5b7e8fff0aed30f32c451020953
tree769ae87a18b139fc9c5cdd0c5172ab8aae017fcf
parent2a6e66fced05c112847720d6d677951b41c177a7
dm verity fec: fix GFP flags used with mempool_alloc()

mempool_alloc() cannot fail for GFP_NOIO allocation, so there is no
point testing for failure.

One place the code tested for failure was passing "0" as the GFP
flags.  This is most unusual and is probably meant to be GFP_NOIO,
so that is changed.

Also, allocation from ->extra_pool and ->prealloc_pool are repeated
before releasing the previous allocation.  This can deadlock if the code
is servicing a write under high memory pressure.  To avoid deadlocks,
change these to use GFP_NOWAIT and leave the error handling in place.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-verity-fec.c