From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752607AbcKQXVk (ORCPT ); Thu, 17 Nov 2016 18:21:40 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33528 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750928AbcKQXVh (ORCPT ); Thu, 17 Nov 2016 18:21:37 -0500 Date: Fri, 18 Nov 2016 02:21:34 +0300 From: "Kirill A. Shutemov" To: Johannes Weiner Cc: Andrew Morton , Jan Kara , Linus Torvalds , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH 2/9] mm: khugepaged: fix radix tree node leak in shmem collapse error path Message-ID: <20161117232134.GB8358@node> References: <20161117191138.22769-1-hannes@cmpxchg.org> <20161117191138.22769-3-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161117191138.22769-3-hannes@cmpxchg.org> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 17, 2016 at 02:11:31PM -0500, Johannes Weiner wrote: > The radix tree counts valid entries in each tree node. Entries stored > in the tree cannot be removed by simpling storing NULL in the slot or > the internal counters will be off and the node never gets freed again. > > When collapsing a shmem page fails, restore the holes that were filled > with radix_tree_insert() with a proper radix tree deletion. > > Fixes: f3f0e1d2150b ("khugepaged: add support of collapse for tmpfs/shmem pages") > Reported-by: Jan Kara > Signed-off-by: Johannes Weiner Acked-by: Kirill A. Shutemov -- Kirill A. Shutemov