Re: [PATCH -mm] mm, swap: Fix swap space leak in error path of swap_free_entries()
From: Tim Chen
Date: Fri Apr 21 2017 - 15:19:46 EST
On Fri, 2017-04-21 at 20:47 +0800, Huang, Ying wrote:
> From: Huang Ying <ying.huang@xxxxxxxxx>
>
> In swapcache_free_entries(), if swap_info_get_cont() return NULL,
> something wrong occurs for the swap entry.ÂÂBut we should still
> continue to free the following swap entries in the array instead of
> skip them to avoid swap space leak.ÂÂThis is just problem in error
> path, where system may be in an inconsistent state, but it is still
> good to fix it.
>
Acked-by: Tim Chen <tim.c.chen@xxxxxxxxxxxxxxx>
> Signed-off-by: "Huang, Ying" <ying.huang@xxxxxxxxx>
> Cc: Tim Chen <tim.c.chen@xxxxxxxxx>
> Cc: Rik van Riel <riel@xxxxxxxxxx>
> Cc: Hugh Dickins <hughd@xxxxxxxxxx>
> Cc: Shaohua Li <shli@xxxxxxxxxx>
> Cc: Minchan Kim <minchan@xxxxxxxxxx>
> ---