From: Matthew Wilcox <mawilcox@xxxxxxxxxxxxx> We have a perfectly good macro to determine whether the gfp flags allow you to sleep or not; use it instead of trying to infer it. Signed-off-by: Matthew Wilcox <mawilcox@xxxxxxxxxxxxx> diff --git a/mm/z3fold.c b/mm/z3fold.c index d589d318727f..46fed640a956 100644 --- a/mm/z3fold.c +++ b/mm/z3fold.c @@ -533,7 +533,7 @@ static int z3fold_alloc(struct z3fold_pool *pool, size_t size, gfp_t gfp, struct z3fold_header *zhdr = NULL; struct page *page = NULL; enum buddy bud; - bool can_sleep = (gfp & __GFP_RECLAIM) == __GFP_RECLAIM; + bool can_sleep = gfpflags_allow_blocking(gfp); if (!size || (gfp & __GFP_HIGHMEM)) return -EINVAL;