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 13862C25B08 for ; Wed, 17 Aug 2022 13:59:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239841AbiHQN7x (ORCPT ); Wed, 17 Aug 2022 09:59:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239805AbiHQN7X (ORCPT ); Wed, 17 Aug 2022 09:59:23 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BDE797D50 for ; Wed, 17 Aug 2022 06:59:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=H3k3eKgkc5W/rypnQlEYEwtVCCUR+mQYx2LOi4yW/+Q=; b=cm+td3tAk+z+UeZIKGm2BQimMI G68sGwut1or1CrTRAdKSz9+i/NBYOcukgv5qMQoudP6zHuZvF7BaDfO3CVW9MBl7SNy3ULF1PpFC0 izh2TY1oV6zthDLFaEKiKTMbW7nfE/P59wHmKyFWNtaVqZkeDnUzmFZGRpFxJx6gCYexKAXnIcX8g Mhcg0Bu8EGhE7s4W+3KliLVYwnPDxy2ZMibHVKqMNJwTQPJeJYVMExqs+/kixoqpLUGIa/4VRByNG ElenP+Webex1t6HqquAEYHcg1xFgNNbL3m52J/yJYdoMvr/tFmVAKlh9jpyrGGrpalFZO4IwZO8dO TwQU4yzQ==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1oOJZW-005Nio-RP; Wed, 17 Aug 2022 13:59:02 +0000 Date: Wed, 17 Aug 2022 14:59:02 +0100 From: Al Viro To: Christian Brauner Cc: Greg Kroah-Hartman , Dongliang Mu , Dongliang Mu , Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Carlos Llamas , Suren Baghdasaryan , Kees Cook , syzkaller , linux-kernel Subject: Re: [PATCH] binderfs: rework superblock destruction Message-ID: References: <20220817130306.96978-1-brauner@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220817130306.96978-1-brauner@kernel.org> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 17, 2022 at 03:03:06PM +0200, Christian Brauner wrote: > +static void binderfs_kill_super(struct super_block *sb) > +{ > + struct binderfs_info *info = sb->s_fs_info; > + > + if (info && info->ipc_ns) > + put_ipc_ns(info->ipc_ns); > + > + kfree(info); > + kill_litter_super(sb); > +} Other way round, please - shut the superblock down, *then* free the objects it'd been using. IOW, struct binderfs_info *info = sb->s_fs_info; kill_litter_super(sb); if (info && info->ipc_ns) put_ipc_ns(info->ipc_ns); kfree(info);