Skip to content

Commit

Permalink
mm/z3fold: fix sheduling while atomic
Browse files Browse the repository at this point in the history
Patch series "A few fixup patches for z3fold".

This series contains a few fixup patches to fix sheduling while atomic,
fix possible null pointer dereferencing, fix various race conditions and
so on. More details can be found in the respective changelogs.


This patch (of 9):

z3fold's page_lock is always held when calling alloc_slots.  So gfp should
be GFP_ATOMIC to avoid "scheduling while atomic" bug.

Link: https://lkml.kernel.org/r/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Fixes: fc54886 ("z3fold: simplify freeing slots")
Signed-off-by: Miaohe Lin <[email protected]>
Reviewed-by: Vitaly Wool <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
MiaoheLin authored and akpm00 committed May 27, 2022
1 parent 86d28b0 commit 4c6bdb3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mm/z3fold.c
Original file line number Diff line number Diff line change
Expand Up @@ -941,8 +941,7 @@ static inline struct z3fold_header *__z3fold_alloc(struct z3fold_pool *pool,
}

if (zhdr && !zhdr->slots)
zhdr->slots = alloc_slots(pool,
can_sleep ? GFP_NOIO : GFP_ATOMIC);
zhdr->slots = alloc_slots(pool, GFP_ATOMIC);
return zhdr;
}

Expand Down

0 comments on commit 4c6bdb3

Please sign in to comment.