Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Register correct handlers in nvlist_alloc()
The non-blocking allocation handlers in nvlist_alloc() would be mistakenly assigned if any flags other than KM_SLEEP were passed. This meant that nvlists allocated with KM_PUSHPUSH or other KM_* debug flags were effectively always using atomic allocations. While these failures were unlikely it could lead to assertions because KM_PUSHPAGE allocation in particular are guaranteed to succeed or block. They must never fail. Since this code is already wrapped in a _KERNEL define the cleanest fix is to check the __GFP_HIGH bit. When set the caller is signaling it is safe for the allocation to block, when it's clear atomic allocations must be used. Signed-off-by: Brian Behlendorf <[email protected]> Issue openzfs/spl#249