Skip to content
Commit 34c96507 authored by NeilBrown's avatar NeilBrown Committed by Mike Snitzer
Browse files

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: default avatarNeilBrown <neilb@suse.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 4218a955
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment