From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 154C7C38145 for ; Fri, 2 Sep 2022 13:52:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235672AbiIBNwx (ORCPT ); Fri, 2 Sep 2022 09:52:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238016AbiIBNwY (ORCPT ); Fri, 2 Sep 2022 09:52:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F10F4134193 for ; Fri, 2 Sep 2022 06:26:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B7B96B829FB for ; Fri, 2 Sep 2022 12:46:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B85A0C433D6; Fri, 2 Sep 2022 12:46:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662122807; bh=hW87bCjg7mhQfCQ8qK8L55df2bf6Oy03cAkiFazu4jQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gRtcezHyRLdYAKxIdu4kAggfw0eKH/zs1cQ2efUFrRo1AS30kqqkFagEU4KstWLaC 04G/dmgX/kISBd/LoWRLHYmMNdFXr/H//90i3ynoJMrukKa0x2LLegCo3gOK5tG8XU Pn4Yyz/D+SLbGUrDGTlabt8F51O7Zlp55hsTB3kE= Date: Fri, 2 Sep 2022 14:46:44 +0200 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Major Chen , stable , Kuyo Chang , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Matthias Brugger Subject: Re: [PATCH 2/2] sched/debug: fix dentry leak in update_sched_domain_debugfs Message-ID: References: <20220902123107.109274-1-gregkh@linuxfoundation.org> <20220902123107.109274-2-gregkh@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220902123107.109274-2-gregkh@linuxfoundation.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 02, 2022 at 02:31:07PM +0200, Greg Kroah-Hartman wrote: > Kuyo reports that the pattern of using debugfs_remove(debugfs_lookup()) > leaks a dentry and with a hotplug stress test, the machine eventually > runs out of memory. > > Fix this up by using the newly created debugfs_lookup_and_remove() call > instead which properly handles the dentry reference counting logic. > > Cc: Major Chen > Cc: stable > Reported-by: Kuyo Chang > Tested-by: Kuyo Chang > Cc: Ingo Molnar > Cc: Peter Zijlstra > Cc: Juri Lelli > Cc: Vincent Guittot > Cc: Dietmar Eggemann > Cc: Steven Rostedt > Cc: Ben Segall > Cc: Mel Gorman > Cc: Daniel Bristot de Oliveira > Cc: Valentin Schneider > Cc: Matthias Brugger > Signed-off-by: Greg Kroah-Hartman > --- > kernel/sched/debug.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) As this needs patch 1/2 to work properly, and Kuyo has tested this out already, I'll take both of them through my driver core git tree to Linus so that we can start getting the other debugfs_lookup() leaks fixed up as well. thanks, greg k-h