diff options
author | Slava Pestov <sp@daterainc.com> | 2015-01-20 21:43:03 -0800 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2015-01-26 14:42:28 -0800 |
commit | 765c76be65b32bd3a63ede63077bd221918101d9 (patch) | |
tree | fd2fef4ee0e748d6855f47d47f5a5461ecf7869b | |
parent | d3719d8f537b97d4bfe869f5a26c99d489263819 (diff) |
dynamic faults: fail mempool_alloc() if __GFP_WAIT not setdynamic_faults
Change-Id: I5618cdbe2e0d61061549d8c4ebf0332c2bd78e28
-rw-r--r-- | include/linux/dynamic_fault.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/dynamic_fault.h b/include/linux/dynamic_fault.h index 6322b85838e1..cc08373ece90 100644 --- a/include/linux/dynamic_fault.h +++ b/include/linux/dynamic_fault.h @@ -73,6 +73,10 @@ bool __dynamic_fault_enabled(struct _dfault *); #define krealloc(...) \ (memory_fault() ? NULL : krealloc(__VA_ARGS__)) +#define mempool_alloc(pool, gfp_mask) \ + ((!((gfp_mask) & __GFP_WAIT) && memory_fault()) \ + ? NULL : mempool_alloc(pool, gfp_mask)) + #define __get_free_pages(...) \ (memory_fault() ? 0 : __get_free_pages(__VA_ARGS__)) #define alloc_pages_node(...) \ |