z3fold: fix retry mechanism in page reclaim
z3fold_page_reclaim()'s retry mechanism is broken: on a second iteration
it will have zhdr from the first one so that zhdr is no longer in line
with struct page. That leads to crashes when the system is stressed.
Fix that by moving zhdr assignment up.
While at it, protect against using already freed handles by using own
local slots structure in z3fold_page_reclaim().
Signed-off-by: Vitaly Wool <email@example.com>
Reported-by: Markus Linnala <firstname.lastname@example.org>
Reported-by: Chris Murphy <email@example.com>
Reported-by: Agustin Dall'Alba <firstname.lastname@example.org>
Cc: "Maciej S. Szmigiero" <email@example.com>
Cc: Shakeel Butt <firstname.lastname@example.org>
Cc: Henry Burns <email@example.com>
Signed-off-by: Andrew Morton <firstname.lastname@example.org>
Signed-off-by: Linus Torvalds <email@example.com>