From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424780AbdDUTTn (ORCPT ); Fri, 21 Apr 2017 15:19:43 -0400 Received: from mga11.intel.com ([192.55.52.93]:48695 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424758AbdDUTTj (ORCPT ); Fri, 21 Apr 2017 15:19:39 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,230,1488873600"; d="scan'208";a="77282284" Message-ID: <1492791012.3209.2.camel@linux.intel.com> Subject: Re: [PATCH -mm] mm, swap: Fix swap space leak in error path of swap_free_entries() From: Tim Chen To: "Huang, Ying" , Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Tim Chen , Rik van Riel , Hugh Dickins , Shaohua Li , Minchan Kim Date: Fri, 21 Apr 2017 09:10:12 -0700 In-Reply-To: <20170421124739.24534-1-ying.huang@intel.com> References: <20170421124739.24534-1-ying.huang@intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.5.2 (3.18.5.2-1.fc23) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2017-04-21 at 20:47 +0800, Huang, Ying wrote: > From: Huang Ying > > 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 > Signed-off-by: "Huang, Ying" > Cc: Tim Chen > Cc: Rik van Riel > Cc: Hugh Dickins > Cc: Shaohua Li > Cc: Minchan Kim > ---