Commit 58e97ba6b1a0c78d0c847998cf3bcfa5344c19aa
Committed by
Linus Torvalds
1 parent
2de1a7e40a
Exists in
master
and in
16 other branches
frontswap: enable call to invalidate area on swapoff
During swapoff the frontswap_map was NULL-ified before calling frontswap_invalidate_area(). However the frontswap_invalidate_area() exits early if frontswap_map is NULL. Invalidate was never called during swapoff. This patch moves frontswap_map_set() in swapoff just after calling frontswap_invalidate_area() so outside of locks (swap_lock and swap_info_struct->lock). This shouldn't be a problem as during swapon the frontswap_map_set() is called also outside of any locks. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Reviewed-by: Seth Jennings <sjenning@linux.vnet.ibm.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Shaohua Li <shli@fusionio.com> Cc: Minchan Kim <minchan@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff
mm/swapfile.c
... | ... | @@ -1924,10 +1924,10 @@ |
1924 | 1924 | p->cluster_info = NULL; |
1925 | 1925 | p->flags = 0; |
1926 | 1926 | frontswap_map = frontswap_map_get(p); |
1927 | - frontswap_map_set(p, NULL); | |
1928 | 1927 | spin_unlock(&p->lock); |
1929 | 1928 | spin_unlock(&swap_lock); |
1930 | 1929 | frontswap_invalidate_area(type); |
1930 | + frontswap_map_set(p, NULL); | |
1931 | 1931 | mutex_unlock(&swapon_mutex); |
1932 | 1932 | free_percpu(p->percpu_cluster); |
1933 | 1933 | p->percpu_cluster = NULL; |