Re: [PATCH 5/5] mm/swap_state: fix swap_cluster_readahead() race with swapoff

2021-04-13 Thread Miaohe Lin
On 2021/4/13 9:36, Huang, Ying wrote: > Miaohe Lin writes: > >> swap_cluster_readahead() could race with swapoff and might dereference >> si->swap_file after it's released by swapoff. Close this race window by >> using get/put_swap_device() pair. > > I think we should fix the callers instead to

Re: [PATCH 5/5] mm/swap_state: fix swap_cluster_readahead() race with swapoff

2021-04-12 Thread Huang, Ying
Miaohe Lin writes: > swap_cluster_readahead() could race with swapoff and might dereference > si->swap_file after it's released by swapoff. Close this race window by > using get/put_swap_device() pair. I think we should fix the callers instead to reduce the overhead. Now, do_swap_page() has bee

[PATCH 5/5] mm/swap_state: fix swap_cluster_readahead() race with swapoff

2021-04-08 Thread Miaohe Lin
swap_cluster_readahead() could race with swapoff and might dereference si->swap_file after it's released by swapoff. Close this race window by using get/put_swap_device() pair. Signed-off-by: Miaohe Lin --- mm/swap_state.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff -