diff options
author | Vitaly Wool <vitalywool@gmail.com> | 2017-10-04 01:14:47 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-10-04 02:54:24 +0200 |
commit | d5567c9df1ef001b2a7e6684b3b3498371ee4cae (patch) | |
tree | b3ce7486314ee88b61cb34f010947c6b40f8548f /mm/oom_kill.c | |
parent | sh: sh7269: remove nonexistent GPIO_PH[0-7] to fix pinctrl registration (diff) | |
download | linux-d5567c9df1ef001b2a7e6684b3b3498371ee4cae.tar.xz linux-d5567c9df1ef001b2a7e6684b3b3498371ee4cae.zip |
z3fold: fix potential race in z3fold_reclaim_page
It is possible that on a (partially) unsuccessful page reclaim,
kref_put() called in z3fold_reclaim_page() does not yield page release,
but the page is released shortly afterwards by another thread. Then
z3fold_reclaim_page() would try to list_add() that (released) page again
which is obviously a bug.
To avoid that, spin_lock() has to be taken earlier, before the
kref_put() call mentioned earlier.
Link: http://lkml.kernel.org/r/20170913162937.bfff21c7d12b12a5f47639fd@gmail.com
Signed-off-by: Vitaly Wool <vitalywool@gmail.com>
Cc: Dan Streetman <ddstreet@ieee.org>
Cc: <Oleksiy.Avramchenko@sony.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/oom_kill.c')
0 files changed, 0 insertions, 0 deletions